File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -918,6 +918,10 @@ function convertN8nRequestToAxios(n8nRequest: IHttpRequestOptions): AxiosRequest
918
918
919
919
axiosRequest . params = n8nRequest . qs ;
920
920
921
+ if ( n8nRequest . abortSignal ) {
922
+ axiosRequest . signal = n8nRequest . abortSignal ;
923
+ }
924
+
921
925
if ( n8nRequest . baseURL !== undefined ) {
922
926
axiosRequest . baseURL = n8nRequest . baseURL ;
923
927
}
@@ -1718,6 +1722,11 @@ export async function httpRequestWithAuthentication(
1718
1722
) {
1719
1723
removeEmptyBody ( requestOptions ) ;
1720
1724
1725
+ // Cancel this request on execution cancellation
1726
+ if ( 'getExecutionCancelSignal' in this ) {
1727
+ requestOptions . abortSignal = this . getExecutionCancelSignal ( ) ;
1728
+ }
1729
+
1721
1730
let credentialsDecrypted : ICredentialDataDecryptedObject | undefined ;
1722
1731
try {
1723
1732
const parentTypes = additionalData . credentialsHelper . getParentTypes ( credentialsType ) ;
Original file line number Diff line number Diff line change 1
1
/* eslint-disable @typescript-eslint/no-explicit-any */
2
2
3
3
import type { CallbackManager as CallbackManagerLC } from '@langchain/core/callbacks/manager' ;
4
- import type { AxiosProxyConfig } from 'axios' ;
4
+ import type { AxiosProxyConfig , GenericAbortSignal } from 'axios' ;
5
5
import type * as express from 'express' ;
6
6
import type FormData from 'form-data' ;
7
7
import type { PathLike } from 'fs' ;
@@ -529,6 +529,7 @@ export interface IHttpRequestOptions {
529
529
} ;
530
530
timeout ?: number ;
531
531
json ?: boolean ;
532
+ abortSignal ?: GenericAbortSignal ;
532
533
}
533
534
534
535
/**
You can’t perform that action at this time.
0 commit comments