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:
Charles Bochet
2026-02-10 14:14:06 +01:00
committed by GitHub
parent 2e77a68daf
commit b7ff587b5e
6 changed files with 42 additions and 32 deletions
@@ -10,7 +10,7 @@ export const transformEventBatchToWebhookEvents = ({
webhooks,
}: {
workspaceEventBatch: WorkspaceEventBatch<ObjectRecordEvent>;
webhooks: WebhookEntity[];
webhooks: Pick<WebhookEntity, 'id' | 'targetUrl' | 'secret'>[];
}): CallWebhookJobData[] => {
const result: CallWebhookJobData[] = [];