Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

fix job naming

Thiago Araujo da Silva1095970252d4
diff --git a/backend/src/ee/services/audit-log-stream-outbox/audit-log-stream-outbox-service.ts b/backend/src/ee/services/audit-log-stream-outbox/audit-log-stream-outbox-service.ts
index 27fc8b1357..00fdc8c0d4 100644
--- a/backend/src/ee/services/audit-log-stream-outbox/audit-log-stream-outbox-service.ts
+++ b/backend/src/ee/services/audit-log-stream-outbox/audit-log-stream-outbox-service.ts
@@ -123,18 +123,25 @@ export const auditLogStreamOutboxServiceFactory = ({
const acquired = await keyStore.setItemWithExpiryNX(debounceKey, FLUSH_DEBOUNCE_SECONDS, "1");
if (!acquired) return false;
- // Job ID matches the debounce key so BullMQ collapses any in-flight duplicates.
- await queueService.queue(
- queueName,
- QueueJobs.AuditLogStreamFlush,
- { streamId, orgId, provider },
- {
- jobId: `flush:${streamId}`,
- delay: FLUSH_DEBOUNCE_MS,
- removeOnComplete: true,
- removeOnFail: { count: 50 }
- }
- );
+ try {
+ await queueService.queue(
+ queueName,
+ QueueJobs.AuditLogStreamFlush,
+ { streamId, orgId, provider },
+ {
+ jobId: `flush-${streamId}`,
+ delay: FLUSH_DEBOUNCE_MS,
+ removeOnComplete: true,
+ removeOnFail: { count: 50 }
+ }
+ );
+ } catch (error) {
+ logger.error(
+ error,
+ `audit-log-stream-outbox: failed to enqueue flush job [provider=${provider}] [queue=${queueName}] [streamId=${streamId}] [orgId=${orgId}]`
+ );
+ return false;
+ }
return true;
};