feat: implement time wheel for scheduling tasks and refactor bond and steam playing checks to use new task scheduling utility
This commit is contained in:
@@ -176,11 +176,11 @@ func checkSteamPlaying(msg model.Message) model.Reply {
|
||||
func RoundCheckSteamPlaying() {
|
||||
once := true
|
||||
playingMap := map[int64]map[string]string{}
|
||||
for {
|
||||
util.AddCycleTask("checkSteamPlaying", 15*time.Second, 15*time.Second, func() {
|
||||
groups, err := getAllGroupID()
|
||||
if err != nil {
|
||||
fmt.Println("获取群列表失败: ", err)
|
||||
continue
|
||||
return
|
||||
}
|
||||
|
||||
for _, group := range groups {
|
||||
@@ -212,5 +212,5 @@ func RoundCheckSteamPlaying() {
|
||||
}
|
||||
}
|
||||
once = false
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user