fix: stabilize cron scheduling and run history

This commit is contained in:
Winnie
2026-08-17 18:55:31 +08:00
parent 23823325e6
commit ff700d8db4
16 changed files with 320 additions and 55 deletions
@@ -553,7 +553,11 @@ export const useSchedulesStore = create<State & Actions>((set, get) => {
} catch (error) {
if (showLoading) await handleError(error, "运行记录加载失败");
} finally {
if (showLoading) set({ runsLoading: false });
// 如果用户已切换到另一个调度方案,不能让旧请求结束时覆盖新方案的
// 加载状态;新方案会由自己的请求负责关闭 loading。
if (showLoading && get().schedule?.schedule_id === scheduleId) {
set({ runsLoading: false });
}
}
},