mirror of
https://hubproxy.babadafafafafa.cn/https://github.com/yunionio/cloudpods.git
synced 2026-09-20 08:03:53 +08:00
Merge pull request #12565 from rainzm/automated-cherry-pick-of-#12564-upstream-release-3.8
Automated cherry pick of #12564: fix(region): init timerQueue correctly
This commit is contained in:
@@ -571,9 +571,12 @@ func (stm *SScheduledTaskManager) timeScope(median time.Time, interval time.Dura
|
||||
}
|
||||
}
|
||||
|
||||
var timerQueue = make(chan struct{}, cop.Options.ScheduledTaskQueueSize)
|
||||
var timerQueue chan struct{}
|
||||
|
||||
func (stm *SScheduledTaskManager) Timer(ctx context.Context, userCred mcclient.TokenCredential, isStart bool) {
|
||||
if timerQueue == nil {
|
||||
timerQueue = make(chan struct{}, cop.Options.ScheduledTaskQueueSize)
|
||||
}
|
||||
// 60 is for fault tolerance
|
||||
interval := 60 + 30
|
||||
timeScope := stm.timeScope(time.Now(), time.Duration(interval)*time.Second)
|
||||
|
||||
Reference in New Issue
Block a user