Reduce server file refresh latency
This commit is contained in:
@@ -12,7 +12,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
defaultJobPollSeconds = 2
|
defaultJobPollSeconds = 1
|
||||||
defaultJobMaxAttempts = 3
|
defaultJobMaxAttempts = 3
|
||||||
defaultJobInitialBackoffSeconds = 2
|
defaultJobInitialBackoffSeconds = 2
|
||||||
defaultJobMaxBackoffSeconds = 60
|
defaultJobMaxBackoffSeconds = 60
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ describe("ServerDetailPage config write approval", () => {
|
|||||||
it("keeps the server file manager list-first without plugin declaration gates", () => {
|
it("keeps the server file manager list-first without plugin declaration gates", () => {
|
||||||
expect(serverDetailPageSource).toContain("server-file-editor-overlay");
|
expect(serverDetailPageSource).toContain("server-file-editor-overlay");
|
||||||
expect(serverDetailPageSource).toContain("refreshRuntimeList({ silent: true })");
|
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("if (!options.silent) setList({ status: \"loading\" })");
|
||||||
expect(serverDetailPageSource).toContain("serverFileListPendingLabel");
|
expect(serverDetailPageSource).toContain("serverFileListPendingLabel");
|
||||||
expect(serverDetailPageSource).not.toContain("server-file-layout");
|
expect(serverDetailPageSource).not.toContain("server-file-layout");
|
||||||
|
|||||||
@@ -631,7 +631,7 @@ function ServerFilesSection({ instance, session, operations }: ServerFilesSectio
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (workspace.status !== "ready" || !directoryKey || list.status !== "ready" || list.data.state !== "pending") return;
|
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);
|
return () => window.clearInterval(timer);
|
||||||
}, [directoryKey, list, loadList, workspace.status]);
|
}, [directoryKey, list, loadList, workspace.status]);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user