sql version => test the case of online

This commit is contained in:
eson 2020-12-15 16:58:38 +08:00
parent 9e3850805f
commit 962c5b36b6

View File

@ -59,8 +59,9 @@ func collectCopyCountLiveAnchors(cxt *WorkerContext) {
} }
c.CountMap = string(data) c.CountMap = string(data)
err = T.CountLiveAnchors.Create(c).Error insertsql := fmt.Sprintf("insert ignore into %s(uid, is_counted, count_map, create_at) values(?,?,?,?)", Tables.CountLiveAnchors)
_, err = db.Exec(insertsql, c.UID, c.IsCounted, c.CountMap, c.CreateAt)
if err != nil {
switch merr := err.(*mysql.MySQLError); merr.Number { switch merr := err.(*mysql.MySQLError); merr.Number {
case 1062: case 1062:
@ -69,6 +70,7 @@ func collectCopyCountLiveAnchors(cxt *WorkerContext) {
} }
} }
} }
}
}) })
ps.Wait(time.Second * 5) ps.Wait(time.Second * 5)