This commit is contained in:
@@ -314,10 +314,13 @@ func startPollingInitializer(ctx context.Context, runtime *workerRuntime, appLog
|
||||
pollingInitializer.StartBackground(ctx)
|
||||
|
||||
runtime.pollingConfigMgr.WatchChanges(ctx, func(hadConfigs, hasConfigs bool) {
|
||||
if !hadConfigs && hasConfigs {
|
||||
appLogger.Info("轮询配置从空变为非空,触发队列重新初始化")
|
||||
if hasConfigs {
|
||||
appLogger.Info("轮询配置已变更,触发队列重新初始化",
|
||||
zap.Bool("had_configs", hadConfigs))
|
||||
pollingInitializer.Restart(ctx)
|
||||
return
|
||||
}
|
||||
appLogger.Info("轮询配置已清空,跳过队列重新初始化")
|
||||
})
|
||||
|
||||
return pollingInitializer
|
||||
|
||||
Reference in New Issue
Block a user