Skip to content

Commit 6323038

Browse files
fix: move sendQuery timeout to request query (#464)
1 parent 33bb8a0 commit 6323038

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/services/api.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -282,19 +282,24 @@ export class YdbEmbeddedAPI extends AxiosWrapper {
282282
},
283283
{concurrentId}: AxiosOptions = {},
284284
) {
285+
// Time difference to ensure that timeout from ui will be shown rather than backend error
286+
const uiTimeout = 9 * 60 * 1000;
287+
const backendTimeout = 10 * 60 * 1000;
288+
285289
return this.post<QueryAPIResponse<Action, Schema>>(
286-
this.getPath(`/viewer/json/query${schema ? `?schema=${schema}` : ''}`),
290+
this.getPath(
291+
`/viewer/json/query?timeout=${backendTimeout}${schema ? `&schema=${schema}` : ''}`,
292+
),
287293
{
288294
query,
289295
database,
290296
action,
291297
stats,
292-
timeout: 10 * 60 * 1000,
293298
},
294299
{},
295300
{
296301
concurrentId,
297-
timeout: 9 * 60 * 1000,
302+
timeout: uiTimeout,
298303
},
299304
);
300305
}

0 commit comments

Comments
 (0)