Skip to content

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

define when maxRetryTime should be displayed for the end user

adilson61400cc32b95
diff --git a/backend/src/ee/services/secret-rotation-v2/secret-rotation-v2-service.ts b/backend/src/ee/services/secret-rotation-v2/secret-rotation-v2-service.ts
index 48999dc284..1e765968e2 100644
--- a/backend/src/ee/services/secret-rotation-v2/secret-rotation-v2-service.ts
+++ b/backend/src/ee/services/secret-rotation-v2/secret-rotation-v2-service.ts
@@ -1100,6 +1100,13 @@ export const secretRotationV2ServiceFactory = ({
} catch (error) {
const errorMessage = parseRotationErrorMessage(error);
+ let nextRetryTime: string | undefined;
+ if (!isManualRotation) {
+ nextRetryTime = isFinalAttempt
+ ? "Maximum retry attempts reached"
+ : new Date(Date.now() + 1000 * 2 ** ((retryCount ?? 1) - 1)).toISOString();
+ }
+
await queueService.queue(
QueueName.SecretWebhook,
QueueJobs.SecWebhook,
@@ -1112,9 +1119,7 @@ export const secretRotationV2ServiceFactory = ({
rotationName: secretRotation.name,
triggeredManually: isManualRotation,
errorMessage,
- nextRetryTime: isFinalAttempt
- ? "Maximum retry attempts reached"
- : new Date(Date.now() + 1000 * 2 ** ((retryCount ?? 1) - 1)).toISOString()
+ nextRetryTime
}
},
{