fix(ActionScheduler): remove triggered hour actions by uuid to avoid removeAll mismatch

This commit is contained in:
2026-02-09 20:03:24 +08:00
parent 406b4250aa
commit 7c46f1d1ff

View File

@@ -140,7 +140,8 @@ class ActionScheduler : AgentRunningSubModule<Set<ScheduledActionData>, Void>()
val bucket = wheel[i] val bucket = wheel[i]
if (bucket.isNotEmpty()) { if (bucket.isNotEmpty()) {
toTrigger.addAll(bucket) toTrigger.addAll(bucket)
actionsGroupByHour[triggerHour].removeAll(bucket) val bucketUuids = bucket.asSequence().map { it.uuid }.toHashSet()
actionsGroupByHour[triggerHour].removeIf { it.uuid in bucketUuids }
bucket.clear() // 避免重复触发 bucket.clear() // 避免重复触发
} }
} }