Skip to content

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

fix: clear deleted audit logs on error to prevent infinite looping of audit log prune

Scott Wilson06de9d06c941
diff --git a/backend/src/ee/services/audit-log/audit-log-dal.ts b/backend/src/ee/services/audit-log/audit-log-dal.ts
index b58f58164c..18a6ba48a2 100644
--- a/backend/src/ee/services/audit-log/audit-log-dal.ts
+++ b/backend/src/ee/services/audit-log/audit-log-dal.ts
@@ -179,6 +179,7 @@ export const auditLogDALFactory = (db: TDbClient) => {
numberOfRetryOnFailure = 0; // reset
} catch (error) {
numberOfRetryOnFailure += 1;
+ deletedAuditLogIds = [];
logger.error(error, "Failed to delete audit log on pruning");
} finally {
// eslint-disable-next-line no-await-in-loop