From fdc1b3f0f14c8c031139c13b1f5202fb7d6fb0e1 Mon Sep 17 00:00:00 2001 From: Sandy Spicer Date: Wed, 26 Jun 2024 14:46:03 -0700 Subject: [PATCH] feat: shorten async query exponential backoff (#23245) --- frontend/src/queries/query.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/queries/query.ts b/frontend/src/queries/query.ts index 0d502ade0404a..a5aec7093d671 100644 --- a/frontend/src/queries/query.ts +++ b/frontend/src/queries/query.ts @@ -21,7 +21,7 @@ import { isTimeToSeeDataSessionsQuery, } from './utils' -const QUERY_ASYNC_MAX_INTERVAL_SECONDS = 5 +const QUERY_ASYNC_MAX_INTERVAL_SECONDS = 3 const QUERY_ASYNC_TOTAL_POLL_SECONDS = 10 * 60 + 6 // keep in sync with backend-side timeout (currently 10min) + a small buffer //get export context for a given query @@ -87,7 +87,7 @@ export async function pollForResults( while (performance.now() - pollStart < QUERY_ASYNC_TOTAL_POLL_SECONDS * 1000) { await delay(currentDelay, methodOptions?.signal) - currentDelay = Math.min(currentDelay * 2, QUERY_ASYNC_MAX_INTERVAL_SECONDS * 1000) + currentDelay = Math.min(currentDelay * 1.25, QUERY_ASYNC_MAX_INTERVAL_SECONDS * 1000) try { const statusResponse = (await api.queryStatus.get(queryId, showProgress)).query_status