feat: 将卡状态任务类型接入队列管理、生命周期和初始化器
queue_manager.go: allTaskTypes 追加 TaskTypePollingCardStatus,注释更正为5个队列 lifecycle_service.go: getEnabledTaskTypes 和 calcInitialDelay 新增 card_status 条件 initializer.go: initBatch 新增 CardStatusCheckInterval 块,以 LastCardStatusCheckAt 为基准写入分片队列 Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -162,6 +162,9 @@ func getEnabledTaskTypes(cfg *model.PollingConfig) []string {
|
||||
if cfg.ProtectCheckInterval != nil && *cfg.ProtectCheckInterval > 0 {
|
||||
types = append(types, constants.TaskTypePollingProtect)
|
||||
}
|
||||
if cfg.CardStatusCheckInterval != nil && *cfg.CardStatusCheckInterval > 0 {
|
||||
types = append(types, constants.TaskTypePollingCardStatus)
|
||||
}
|
||||
return types
|
||||
}
|
||||
|
||||
@@ -188,6 +191,10 @@ func calcInitialDelay(_ *model.IotCard, cfg *model.PollingConfig, taskType strin
|
||||
if cfg.ProtectCheckInterval != nil {
|
||||
interval = *cfg.ProtectCheckInterval
|
||||
}
|
||||
case constants.TaskTypePollingCardStatus:
|
||||
if cfg.CardStatusCheckInterval != nil {
|
||||
interval = *cfg.CardStatusCheckInterval
|
||||
}
|
||||
}
|
||||
if interval <= 0 {
|
||||
return now
|
||||
|
||||
Reference in New Issue
Block a user