修改任务没有执行的问题
This commit is contained in:
+1
-1
@@ -529,7 +529,7 @@ func (c *Cluster) executeTasks() {
|
|||||||
return
|
return
|
||||||
case <-c.ctx.Done():
|
case <-c.ctx.Done():
|
||||||
return
|
return
|
||||||
case <-c.workerChan:
|
case c.workerChan <- struct{}{}:
|
||||||
if c.usePriority && !c.priority.IsLatest(c.ctx) {
|
if c.usePriority && !c.priority.IsLatest(c.ctx) {
|
||||||
time.Sleep(5 * time.Second)
|
time.Sleep(5 * time.Second)
|
||||||
continue
|
continue
|
||||||
|
|||||||
@@ -121,8 +121,8 @@ func InitOnce(ctx context.Context, re redis.UniversalClient, keyPrefix string, c
|
|||||||
keySeparator: "[:]",
|
keySeparator: "[:]",
|
||||||
timeout: op.timeout,
|
timeout: op.timeout,
|
||||||
maxRunCount: op.maxRunCount,
|
maxRunCount: op.maxRunCount,
|
||||||
workerChan: make(chan struct{}, op.maxRunCount),
|
workerChan: make(chan struct{}, op.maxWorkers),
|
||||||
maxWorkers: op.maxRunCount,
|
maxWorkers: op.maxWorkers,
|
||||||
}
|
}
|
||||||
|
|
||||||
// 初始化优先级
|
// 初始化优先级
|
||||||
@@ -289,7 +289,8 @@ func (l *Once) executeTasks() {
|
|||||||
return
|
return
|
||||||
case <-l.ctx.Done():
|
case <-l.ctx.Done():
|
||||||
return
|
return
|
||||||
case <-l.workerChan:
|
case l.workerChan <- struct{}{}:
|
||||||
|
|
||||||
keys, err := l.redis.BLPop(l.ctx, time.Second*10, l.listKey).Result()
|
keys, err := l.redis.BLPop(l.ctx, time.Second*10, l.listKey).Result()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if err != redis.Nil {
|
if err != redis.Nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user