Query cache instead of database for event listener webhook, logicFunction, triggers (#17824)
## Fix Replaced direct database queries with existing flat entity map caches for the two that already have cache infrastructure: - **CallDatabaseEventTriggerJobsJob** - now uses flatLogicFunctionMaps cache via WorkspaceCacheService.getOrRecompute(), filtering in memory for non-deleted logic functions with databaseEventTriggerSettings. - **CallWebhookJobsJob** - now uses flatWebhookMaps cache via WorkspaceCacheService.getOrRecompute(), filtering in memory for webhooks matching the event's operations. - Note: **WorkflowDatabaseEventTriggerListener** - left as-is since WorkflowAutomatedTriggerWorkspaceEntity extends BaseWorkspaceEntity (not SyncableEntity) and has no flat entity map cache infrastructure yet.
This commit is contained in:
+1
-1
@@ -10,7 +10,7 @@ export const transformEventBatchToWebhookEvents = ({
|
||||
webhooks,
|
||||
}: {
|
||||
workspaceEventBatch: WorkspaceEventBatch<ObjectRecordEvent>;
|
||||
webhooks: WebhookEntity[];
|
||||
webhooks: Pick<WebhookEntity, 'id' | 'targetUrl' | 'secret'>[];
|
||||
}): CallWebhookJobData[] => {
|
||||
const result: CallWebhookJobData[] = [];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user