Skip to content

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

fix(pki-sync): record skipped health checks in logs only

Carlos Monastyrskid83254c4c967
diff --git a/backend/src/services/pki-sync/pki-sync-dal.ts b/backend/src/services/pki-sync/pki-sync-dal.ts
index 92dac30619..89f6f24389 100644
--- a/backend/src/services/pki-sync/pki-sync-dal.ts
+++ b/backend/src/services/pki-sync/pki-sync-dal.ts
@@ -353,17 +353,6 @@ export const pkiSyncDALFactory = (db: TDbClient) => {
}
};
- const recordHealthCheckSkipped = async (syncId: string, message: string, tx?: Knex) => {
- try {
- return await (tx || db)(TableName.PkiSync)
- .where({ id: syncId })
- .whereNotNull("lastHealthCheckRanAt")
- .update({ lastHealthCheckMessage: message });
- } catch (error) {
- throw new DatabaseError({ error, name: "Record health check skipped - PKI Sync" });
- }
- };
-
const findFailureNotificationRecipients = async (
pkiSync: { projectId: string; applicationId: string },
tx?: Knex
@@ -429,7 +418,6 @@ export const pkiSyncDALFactory = (db: TDbClient) => {
return {
...pkiSyncOrm,
recordHealthCheckOutcome,
- recordHealthCheckSkipped,
findFailureNotificationRecipients,
findPkiSyncsWithHealthCheckCommand,
findByProjectId,
diff --git a/backend/src/services/pki-sync/pki-sync-health-check-queue.ts b/backend/src/services/pki-sync/pki-sync-health-check-queue.ts
index c5648f2c56..0fed805f31 100644
--- a/backend/src/services/pki-sync/pki-sync-health-check-queue.ts
+++ b/backend/src/services/pki-sync/pki-sync-health-check-queue.ts
@@ -69,7 +69,6 @@ type TPkiSyncHealthCheckQueueFactoryDep = {
| "findPkiSyncsWithHealthCheckCommand"
| "transaction"
| "recordHealthCheckOutcome"
- | "recordHealthCheckSkipped"
| "findById"
>;
keyStore: Pick<TKeyStoreFactory, "acquireLock" | "incrementByAndRefreshExpiryIfUnderLimit" | "decrementByOrDelete">;
@@ -451,17 +450,13 @@ export const pkiSyncHealthCheckQueueFactory = ({
async (job) => {
const isFinalAttempt = job.attemptsStarted >= (job.opts.attempts ?? JOB_ATTEMPTS);
- const outcome = await $processHealthCheck(job.data.syncId, isFinalAttempt).catch((err: unknown) => {
+ await $processHealthCheck(job.data.syncId, isFinalAttempt).catch((err: unknown) => {
logger.error(
{ err, syncId: job.data.syncId },
`cron[${CronJobName.PkiSyncHealthCheck}]: check could not be run [syncId=${job.data.syncId}] [attempt=${job.attemptsStarted}]`
);
throw err;
});
-
- if (outcome.skipped && isFinalAttempt) {
- await pkiSyncDAL.recordHealthCheckSkipped(job.data.syncId, SKIP_MESSAGES[outcome.skipped]);
- }
},
{ concurrency: WORKER_CONCURRENCY, limiter: { max: RATE_LIMIT_MAX, duration: RATE_LIMIT_DURATION_MS } }
);