test
This commit is contained in:
parent
491c9a8029
commit
a6c99c7f7b
9
sql.go
9
sql.go
@ -6,6 +6,8 @@ import (
|
||||
"log"
|
||||
"regexp"
|
||||
"strconv"
|
||||
|
||||
"github.com/go-sql-driver/mysql"
|
||||
)
|
||||
|
||||
func initDB() {
|
||||
@ -659,7 +661,12 @@ func insertMsgTributesStats(m *ChatWarsMessageTributesStatsAck) error {
|
||||
|
||||
for _, t := range m.Tributes {
|
||||
_, err = stmt.Exec(m.Msg.TGUserID64, t.ItemID64, t.Quantity, t.Exp, t.Date)
|
||||
logOnError(err, "insertMsgTributesStats Exec")
|
||||
mysqlerr, ok := err.(*mysql.MySQLError)
|
||||
if ok && mysqlerr.Number == 1062 {
|
||||
// duplicate, expected
|
||||
} else {
|
||||
logOnError(err, "insertMsgTributesStats Exec")
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
|
Loading…
Reference in New Issue
Block a user