From ddd092298837b4b22ba4fb0e7d9ca992203b7cd7 Mon Sep 17 00:00:00 2001 From: kurilova Date: Tue, 11 Mar 2025 11:31:42 +0000 Subject: [PATCH] Increase timeout value for /export request --- .../ui/src/app/interceptors/error.interceptor.ts | 14 +++++++++----- modules/ui/src/app/services/test-run.service.ts | 1 + 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/modules/ui/src/app/interceptors/error.interceptor.ts b/modules/ui/src/app/interceptors/error.interceptor.ts index 9e653895a..cfd4452a8 100644 --- a/modules/ui/src/app/interceptors/error.interceptor.ts +++ b/modules/ui/src/app/interceptors/error.interceptor.ts @@ -30,11 +30,12 @@ import { } from 'rxjs'; import { NotificationService } from '../services/notification.service'; -import { SYSTEM_STOP } from '../services/test-run.service'; +import { SYSTEM_STOP, EXPORT } from '../services/test-run.service'; import { finalize } from 'rxjs/operators'; const DEFAULT_TIMEOUT_MS = 5000; const SYSTEM_STOP_TIMEOUT_MS = 60 * 1000; +const EXPORT_ZIP_TIMEOUT_MS = 60 * 1000; @Injectable() export class ErrorInterceptor implements HttpInterceptor { @@ -45,10 +46,13 @@ export class ErrorInterceptor implements HttpInterceptor { next: HttpHandler, timeoutMs = DEFAULT_TIMEOUT_MS ): Observable> { - const timeoutValue = - request.url.includes(SYSTEM_STOP) || this.isTestrunStop - ? SYSTEM_STOP_TIMEOUT_MS - : timeoutMs; + let timeoutValue = timeoutMs; + if (request.url.includes(SYSTEM_STOP) || this.isTestrunStop) { + timeoutValue = SYSTEM_STOP_TIMEOUT_MS; + } + if (request.url.includes(EXPORT)) { + timeoutValue = EXPORT_ZIP_TIMEOUT_MS; + } if (request.url.includes(SYSTEM_STOP)) { this.isTestrunStop = true; } diff --git a/modules/ui/src/app/services/test-run.service.ts b/modules/ui/src/app/services/test-run.service.ts index ed252361d..df9f2b46a 100644 --- a/modules/ui/src/app/services/test-run.service.ts +++ b/modules/ui/src/app/services/test-run.service.ts @@ -37,6 +37,7 @@ import { const API_URL = `http://${window.location.hostname}:8000`; export const SYSTEM_STOP = '/system/stop'; +export const EXPORT = '/export'; export const UNAVAILABLE_VERSION = { installed_version: 'v?.?',