fix(workbench): make live refresh low priority (#1945)

This commit is contained in:
Lyon
2026-06-23 03:46:18 +08:00
committed by GitHub
parent 83fb750c66
commit 2d3edda3fb
@@ -42,7 +42,12 @@ onBeforeUnmount(() => {
});
watch(() => route.params.sessionId, () => void applyRouteSession());
watch(() => workbench.activeSessionId, (sessionId) => void reflectActiveSessionInUrl(sessionId));
useAutoRefresh(() => workbench.refreshLive(), 30_000, { immediate: false, initialDelayMs: 10_000 });
useAutoRefresh(refreshLiveWhenIdle, 120_000, { immediate: false, initialDelayMs: 90_000 });
async function refreshLiveWhenIdle(): Promise<void> {
if (workbench.loading || workbench.sessionListLoading || workbench.sessionDetailLoading || workbench.chatPending) return;
await workbench.refreshLive();
}
async function applyRouteSession(): Promise<boolean> {
const sessionId = routeRequestId.value;