修改Option与once的实现

This commit is contained in:
yun
2025-10-10 21:03:00 +08:00
parent bae669a1d9
commit 2c762dee2a
5 changed files with 148 additions and 59 deletions
+3 -4
View File
@@ -370,10 +370,7 @@ func (l *Cluster) Cron(ctx context.Context, taskId string, cronExpression string
// 获取当天的零点时间
zeroTime := time.Date(nowTime.Year(), nowTime.Month(), nowTime.Day(), 0, 0, 0, 0, nowTime.Location())
options := Options{}
for _, o := range opt {
o(&options)
}
options := newEmptyOptions(opt...)
cronParser := l.cronParser
if options.cronParser != nil {
cronParser = options.cronParser
@@ -544,6 +541,8 @@ func (c *Cluster) executeTasks() {
}
if len(taskID) < 2 {
c.logger.Errorf(c.ctx, "Invalid BLPop result: %v", taskID)
// 数据异常,继续下一个
continue
}