File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -5,8 +5,17 @@ import { Messages } from '../exceptions/text/messages.js';
55
66@Injectable ( )
77export class TimeoutInterceptor implements NestInterceptor {
8- intercept ( _context : ExecutionContext , next : CallHandler ) : Observable < any > {
9- const timeoutMs = process . env . NODE_ENV !== 'test' ? 15000 : 200000 ;
8+ intercept ( context : ExecutionContext , next : CallHandler ) : Observable < any > {
9+ const request = context . switchToHttp ( ) . getRequest ( ) ;
10+ const isAIEndpoint = request . url . includes ( '/ai/v2/request/' ) ;
11+ const timeoutMs = isAIEndpoint
12+ ? process . env . NODE_ENV !== 'test'
13+ ? 300000
14+ : 600000
15+ : process . env . NODE_ENV !== 'test'
16+ ? 15000
17+ : 200000 ;
18+
1019 return next . handle ( ) . pipe (
1120 timeout ( timeoutMs ) ,
1221 catchError ( ( err ) => {
You can’t perform that action at this time.
0 commit comments