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

This commit is contained in:
Scott Wilson
2025-08-18 14:28:51 +08:00
parent ef6f79f7a6
commit 06de9d06c9

View File

@@ -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