test
This commit is contained in:
parent
491c9a8029
commit
a6c99c7f7b
7
sql.go
7
sql.go
@ -6,6 +6,8 @@ import (
|
||||
"log"
|
||||
"regexp"
|
||||
"strconv"
|
||||
|
||||
"github.com/go-sql-driver/mysql"
|
||||
)
|
||||
|
||||
func initDB() {
|
||||
@ -659,8 +661,13 @@ func insertMsgTributesStats(m *ChatWarsMessageTributesStatsAck) error {
|
||||
|
||||
for _, t := range m.Tributes {
|
||||
_, err = stmt.Exec(m.Msg.TGUserID64, t.ItemID64, t.Quantity, t.Exp, t.Date)
|
||||
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