Skip to content

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

fix: remove order by in audit log prune job

Scott Wilson2dcedb2f1204
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 624b4496f7..be8476a436 100644
--- a/backend/src/ee/services/audit-log/audit-log-dal.ts
+++ b/backend/src/ee/services/audit-log/audit-log-dal.ts
@@ -241,7 +241,6 @@ export const auditLogDALFactory = (db: TDbClient) => {
const findExpiredLogSubQuery = trx(TableName.AuditLog)
.where("expiresAt", "<", today)
.where("createdAt", "<", today) // to use audit log partition
- .orderBy(`${TableName.AuditLog}.createdAt`, "desc")
.select("id")
.limit(AUDIT_LOG_PRUNE_BATCH_SIZE);