Skip to content

Commit 2da04a2

Browse files
committed
fix: timeout interceptor
1 parent 4dc08fa commit 2da04a2

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

libs/interceptors/http-timeout.interceptor.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
NestInterceptor,
66
RequestTimeoutException,
77
} from '@nestjs/common';
8+
import { Request } from 'express';
89
import { throwError, TimeoutError } from 'rxjs';
910
import { catchError, timeout } from 'rxjs/operators';
1011

@@ -13,6 +14,11 @@ const REQUEST_TIMEOUT_SECONDS = 30 * 1000;
1314
@Injectable()
1415
export class HttpTimeoutInterceptor implements NestInterceptor {
1516
intercept(context: ExecutionContext, next: CallHandler) {
17+
const request = context.switchToHttp().getRequest<Request>();
18+
if (request.url?.includes('/exports') || request.url?.includes('/tasks')) {
19+
return next.handle();
20+
}
21+
1622
return next.handle().pipe(
1723
timeout(REQUEST_TIMEOUT_SECONDS),
1824
catchError((error: Error) => {

0 commit comments

Comments
 (0)