From 7cb565fd1bb79038c83ccf2c857b5a0e10512ca9 Mon Sep 17 00:00:00 2001 From: slhafzjw Date: Sun, 8 Feb 2026 21:56:35 +0800 Subject: [PATCH] fix(ActionScheduler): use `withTimeoutOrNull` when waiting for ACTIVE state, to avoid exception leading to wheel stopped --- .../modules/action/dispatcher/scheduler/ActionScheduler.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/dispatcher/scheduler/ActionScheduler.kt b/Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/dispatcher/scheduler/ActionScheduler.kt index 11838311..dd71b924 100644 --- a/Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/dispatcher/scheduler/ActionScheduler.kt +++ b/Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/dispatcher/scheduler/ActionScheduler.kt @@ -137,7 +137,7 @@ class ActionScheduler : AgentRunningSubModule, Void>() val seconds = java.time.Duration.between( actionsLoadingTime, actionsLoadingTime.truncatedTo(ChronoUnit.HOURS).plusHours(1) ).toMillis() - withTimeout(seconds) { + withTimeoutOrNull(seconds) { state.first { it == WheelState.ACTIVE } } state.value = WheelState.SLEEPING