From 0b8e39713dd49866a8872ed95cc5eb7d8c1ac97a Mon Sep 17 00:00:00 2001 From: Daniel Hougaard Date: Tue, 25 Nov 2025 10:25:34 -0800 Subject: [PATCH] Update dynamic-secret-lease-queue.ts --- .../dynamic-secret-lease/dynamic-secret-lease-queue.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/backend/src/ee/services/dynamic-secret-lease/dynamic-secret-lease-queue.ts b/backend/src/ee/services/dynamic-secret-lease/dynamic-secret-lease-queue.ts index 48509c65c..691ba4d00 100644 --- a/backend/src/ee/services/dynamic-secret-lease/dynamic-secret-lease-queue.ts +++ b/backend/src/ee/services/dynamic-secret-lease/dynamic-secret-lease-queue.ts @@ -82,8 +82,8 @@ export const dynamicSecretLeaseQueueServiceFactory = ({ { leaseId }, { singletonKey: `${leaseId}-retry`, // avoid conflicts with scheduled revocation - retryDelay: Math.floor(applyJitter(3_600_000 * 4) / 1000), // retry every 4 hours with 20% +- jitter - retryLimit: 20, // we dont want it to ever hit the limit, we want the expireInHours to take effect. + retryDelay: Math.floor(applyJitter(3_600_000 * 4) / 1000), // retry every 4 hours with 20% +- jitter (convert ms to seconds for pgboss) + retryLimit: 10, // we dont want it to ever hit the limit, we want the expireInHours to take effect. expireInHours: 23, // if we set it to 24 hours, pgboss will complain that the expireIn is too high deadLetter: QueueName.DynamicSecretRevocationFailedRetry // if all fails, we will send a notification to the user } @@ -192,7 +192,6 @@ export const dynamicSecretLeaseQueueServiceFactory = ({ }); // if revocation fails, we should stop the job and queue a new job to retry the revocation at a later time. - await queueService.stopJobById(QueueName.DynamicSecretRevocation, jobId); await queueService.stopJobByIdPg(QueueName.DynamicSecretRevocation, jobId); await queueFailedRevocation(leaseId); }