[Library | new-theme]: timeout-interceptor.service.ts: Increased server and client timeout time when environment != production.

This commit is contained in:
Konstantina Galouni 2022-08-03 18:30:25 +03:00
parent d43f576d40
commit fd9794ec3a
1 changed files with 3 additions and 1 deletions

View File

@ -19,7 +19,9 @@ export class TimeoutInterceptor implements HttpInterceptor {
return next.handle(req); return next.handle(req);
} }
const timeoutValue = isPlatformServer(this.platformId)?3000:6000;//req.headers.get('timeout') || this.defaultTimeout; let serverTime = properties.environment == "production" ? 3000 : 4000;
let clientTime = properties.environment == "production" ? 6000 : 12000;
const timeoutValue = isPlatformServer(this.platformId)?serverTime:clientTime;//req.headers.get('timeout') || this.defaultTimeout;
const timeoutValueNumeric = Number(timeoutValue); const timeoutValueNumeric = Number(timeoutValue);
return next.handle(req).pipe(timeout(timeoutValueNumeric)); return next.handle(req).pipe(timeout(timeoutValueNumeric));
} }