diff --git a/collect.go b/collect.go index e095584..e4b6d6b 100644 --- a/collect.go +++ b/collect.go @@ -59,13 +59,15 @@ func collectCopyCountLiveAnchors(cxt *WorkerContext) { } 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 { + case 1062: - switch merr := err.(*mysql.MySQLError); merr.Number { - case 1062: - - default: - log.Println(merr) + default: + log.Println(merr) + } } } }