mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-22 04:10:01 +00:00
refactor(core): Reduce memory usage in the Webhook node (#4640)
use file streaming to pass webhook binaries around
This commit is contained in:
committed by
GitHub
parent
602b1e56d6
commit
07e4743a3e
@@ -260,6 +260,7 @@ export interface IWebhookFunctions extends IWebhookFunctionsBase {
|
||||
filePath?: string,
|
||||
mimeType?: string,
|
||||
): Promise<IBinaryData>;
|
||||
copyBinaryFile(filePath: string, fileName: string, mimeType?: string): Promise<IBinaryData>;
|
||||
request: (uriOrObject: string | IDataObject | any, options?: IDataObject) => Promise<any>;
|
||||
requestWithAuthentication(
|
||||
this: IAllExecuteFunctions,
|
||||
@@ -306,10 +307,21 @@ export interface IBinaryDataConfig {
|
||||
persistedBinaryDataTTL: number;
|
||||
}
|
||||
|
||||
export interface BinaryMetadata {
|
||||
fileName?: string;
|
||||
mimeType?: string;
|
||||
fileSize: number;
|
||||
}
|
||||
|
||||
export interface IBinaryDataManager {
|
||||
init(startPurger: boolean): Promise<void>;
|
||||
getFileSize(filePath: string): Promise<number>;
|
||||
copyBinaryFile(filePath: string, executionId: string): Promise<string>;
|
||||
storeBinaryMetadata(identifier: string, metadata: BinaryMetadata): Promise<void>;
|
||||
getBinaryMetadata(identifier: string): Promise<BinaryMetadata>;
|
||||
storeBinaryData(binaryBuffer: Buffer, executionId: string): Promise<string>;
|
||||
retrieveBinaryDataByIdentifier(identifier: string): Promise<Buffer>;
|
||||
getBinaryPath(identifier: string): string;
|
||||
markDataForDeletionByExecutionId(executionId: string): Promise<void>;
|
||||
deleteMarkedFiles(): Promise<unknown>;
|
||||
deleteBinaryDataByIdentifier(identifier: string): Promise<void>;
|
||||
|
||||
Reference in New Issue
Block a user