fix(workbench): make live refresh low priority (#1945)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user