Reduce server file refresh latency

This commit is contained in:
npc0-hue
2026-08-26 15:47:34 +08:00
parent e3e1c787be
commit 35f1eb0844
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -12,7 +12,7 @@ import (
)
const (
defaultJobPollSeconds = 2
defaultJobPollSeconds = 1
defaultJobMaxAttempts = 3
defaultJobInitialBackoffSeconds = 2
defaultJobMaxBackoffSeconds = 60
+1 -1
View File
@@ -98,7 +98,7 @@ describe("ServerDetailPage config write approval", () => {
it("keeps the server file manager list-first without plugin declaration gates", () => {
expect(serverDetailPageSource).toContain("server-file-editor-overlay");
expect(serverDetailPageSource).toContain("refreshRuntimeList({ silent: true })");
expect(serverDetailPageSource).toContain("window.setInterval(() => void loadList({ silent: true }), 2000)");
expect(serverDetailPageSource).toContain("window.setInterval(() => void loadList({ silent: true }), 300)");
expect(serverDetailPageSource).toContain("if (!options.silent) setList({ status: \"loading\" })");
expect(serverDetailPageSource).toContain("serverFileListPendingLabel");
expect(serverDetailPageSource).not.toContain("server-file-layout");
+1 -1
View File
@@ -631,7 +631,7 @@ function ServerFilesSection({ instance, session, operations }: ServerFilesSectio
useEffect(() => {
if (workspace.status !== "ready" || !directoryKey || list.status !== "ready" || list.data.state !== "pending") return;
const timer = window.setInterval(() => void loadList({ silent: true }), 2000);
const timer = window.setInterval(() => void loadList({ silent: true }), 300);
return () => window.clearInterval(timer);
}, [directoryKey, list, loadList, workspace.status]);