use minutes for pbs timeout (#2901)

This commit is contained in:
Jonathan Dobson
2025-07-08 14:14:56 -04:00
committed by GitHub
parent c9431fad6f
commit e0fefd9868

View File

@@ -41,10 +41,10 @@ export const useOptimisticallyRequestBrowserSessionId =
} }
const resp = await client.post("/browser_sessions", { const resp = await client.post("/browser_sessions", {
timeout: SESSION_TIMEOUT_MINUTES * 60, // accepts seconds, so have to mult timeout: SESSION_TIMEOUT_MINUTES,
}); });
const { browser_session_id: newBrowserSessionId, timeout } = resp.data; const { browser_session_id: newBrowserSessionId, timeout } = resp.data;
const newExpiresAt = Math.floor(Date.now() / 1000) + timeout * 0.9; const newExpiresAt = Math.floor(Date.now() / 1000) + timeout * 60 * 0.9;
set({ set({
browser_session_id: newBrowserSessionId, browser_session_id: newBrowserSessionId,
expires_at: newExpiresAt, expires_at: newExpiresAt,