chore: update deps

This commit is contained in:
源文雨
2024-11-07 00:12:51 +09:00
parent f5e1c197dd
commit 83ca8c344b
57 changed files with 274 additions and 300 deletions

View File

@@ -22,7 +22,7 @@ func (t *Timer) InsertInto(db *sql.Sqlite) error {
/*
func getTimerFrom(db *sql.Sqlite, id uint32) (t Timer, err error) {
err = db.Find("timer", &t, "where id = "+strconv.Itoa(int(id)))
err = db.Find("timer", &t, "WHERE id = "+strconv.Itoa(int(id)))
return
}
*/

View File

@@ -2,7 +2,6 @@
package timer
import (
"strconv"
"strings"
"sync"
"time"
@@ -29,7 +28,7 @@ type Clock struct {
var (
// @全体成员
atall = message.MessageSegment{
atall = message.Segment{
Type: "at",
Data: map[string]string{
"qq": "all",
@@ -133,7 +132,7 @@ func (c *Clock) CancelTimer(key uint32) bool {
}
c.timersmu.Lock()
delete(*c.timers, key) // 避免重复取消
e := c.db.Del("timer", "where id = "+strconv.Itoa(int(key)))
e := c.db.Del("timer", "WHERE id = ?", key)
c.timersmu.Unlock()
return e == nil
}

View File

@@ -25,8 +25,8 @@ func TestNextWakeTime(t *testing.T) {
}
func TestClock(t *testing.T) {
db := &sql.Sqlite{DBPath: "test.db"}
c := NewClock(db)
db := sql.New("test.db")
c := NewClock(&db)
c.AddTimerIntoDB(GetFilledTimer([]string{"", "12", "-1", "12", "0", "", "test"}, 0, 0, false))
t.Log(c.ListTimers(0))
t.Fail()