Function trigger updates 2 (#16608)
- Improves route trigger job performances - expose function params types ## Before <img width="938" height="271" alt="image" src="https://github.com/user-attachments/assets/5752ba64-f31d-44ed-974d-536e63458f2c" /> ## After <img width="1000" height="559" alt="image" src="https://github.com/user-attachments/assets/b1f4927a-5f43-49f0-a606-244c72356772" />
This commit is contained in:
+12
-7
@@ -21,12 +21,17 @@ export class ServerlessFunctionTriggerJob {
|
||||
) {}
|
||||
|
||||
@Process(ServerlessFunctionTriggerJob.name)
|
||||
async handle(data: ServerlessFunctionTriggerJobData) {
|
||||
await this.serverlessFunctionService.executeOneServerlessFunction({
|
||||
id: data.serverlessFunctionId,
|
||||
workspaceId: data.workspaceId,
|
||||
payload: data.payload || {},
|
||||
version: 'draft',
|
||||
});
|
||||
async handle(serverlessFunctionPayloads: ServerlessFunctionTriggerJobData[]) {
|
||||
await Promise.all(
|
||||
serverlessFunctionPayloads.map(
|
||||
async (serverlessFunctionPayload) =>
|
||||
await this.serverlessFunctionService.executeOneServerlessFunction({
|
||||
id: serverlessFunctionPayload.serverlessFunctionId,
|
||||
workspaceId: serverlessFunctionPayload.workspaceId,
|
||||
payload: serverlessFunctionPayload.payload || {},
|
||||
version: 'draft',
|
||||
}),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user