write lock change to debug

This commit is contained in:
zhiqiang feng
2020-12-28 11:30:16 +08:00
parent fa07d59d07
commit eaf32cf1e7
+2 -2
View File
@@ -137,7 +137,7 @@ func processed(db *sql.DB, t telegram) {
result, err := stmt.Exec(t.id) result, err := stmt.Exec(t.id)
checkDbErr(err, "error in update telegram status") checkDbErr(err, "error in update telegram status")
id, _ := result.RowsAffected() id, _ := result.RowsAffected()
Log.Infof("[%n] telegram update : %b", id, id > 0) Log.Infof("[%s] telegram update : %s", id, id > 0)
isWriting = false isWriting = false
Log.Info("release lock") Log.Info("release lock")
tx.Commit() tx.Commit()
@@ -156,7 +156,7 @@ func countTelegram() int64 {
func getWriteLock() { func getWriteLock() {
count := 0 count := 0
Log.Infof("write lock : %b", isWriting) Log.Debugf("write lock : %s", isWriting)
for isWriting && count < 10 { for isWriting && count < 10 {
Log.Info("waiting for write ") Log.Info("waiting for write ")
time.Sleep(5 * time.Second) time.Sleep(5 * time.Second)