优化了本地定时器+下次的判断

This commit is contained in:
Yun
2025-09-14 19:05:10 +08:00
parent c351cb084f
commit 464b467868
10 changed files with 1662 additions and 209 deletions
+6 -1
View File
@@ -464,7 +464,12 @@ func (c *Cluster) doTask(ctx context.Context, taskId string) {
c.logger.Errorf(ctx, "doTask timer:任务不存在:%s", taskId)
return
}
t := val.(timerStr)
t,ok := val.(timerStr)
if !ok {
c.logger.Errorf(ctx, "doTask timer:任务不存在:%s", taskId)
return
}
// 这里加一个全局锁
lock := lockx.NewGlobalLock(ctx, c.redis, taskId)