mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-06 18:27:19 +00:00
remove health checks for rds and redis
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import { CronJob } from "cron";
|
import { CronJob } from "cron";
|
||||||
import { Redis } from "ioredis";
|
// import { Redis } from "ioredis";
|
||||||
import { Knex } from "knex";
|
import { Knex } from "knex";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
|
||||||
@@ -74,7 +74,6 @@ import { trustedIpDALFactory } from "@app/ee/services/trusted-ip/trusted-ip-dal"
|
|||||||
import { trustedIpServiceFactory } from "@app/ee/services/trusted-ip/trusted-ip-service";
|
import { trustedIpServiceFactory } from "@app/ee/services/trusted-ip/trusted-ip-service";
|
||||||
import { TKeyStoreFactory } from "@app/keystore/keystore";
|
import { TKeyStoreFactory } from "@app/keystore/keystore";
|
||||||
import { getConfig } from "@app/lib/config/env";
|
import { getConfig } from "@app/lib/config/env";
|
||||||
import { logger } from "@app/lib/logger";
|
|
||||||
import { TQueueServiceFactory } from "@app/queue";
|
import { TQueueServiceFactory } from "@app/queue";
|
||||||
import { readLimit } from "@app/server/config/rateLimiter";
|
import { readLimit } from "@app/server/config/rateLimiter";
|
||||||
import { accessTokenQueueServiceFactory } from "@app/services/access-token-queue/access-token-queue";
|
import { accessTokenQueueServiceFactory } from "@app/services/access-token-queue/access-token-queue";
|
||||||
@@ -1306,33 +1305,33 @@ export const registerRoutes = async (
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handler: async (request, reply) => {
|
handler: async () => {
|
||||||
const cfg = getConfig();
|
const cfg = getConfig();
|
||||||
const serverCfg = await getServerCfg();
|
const serverCfg = await getServerCfg();
|
||||||
|
|
||||||
try {
|
// try {
|
||||||
await db.raw("SELECT NOW()");
|
// await db.raw("SELECT NOW()");
|
||||||
} catch (err) {
|
// } catch (err) {
|
||||||
logger.error("Health check: database connection failed", err);
|
// logger.error("Health check: database connection failed", err);
|
||||||
return reply.code(503).send({
|
// return reply.code(503).send({
|
||||||
date: new Date(),
|
// date: new Date(),
|
||||||
message: "Service unavailable"
|
// message: "Service unavailable"
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (cfg.isRedisConfigured) {
|
// if (cfg.isRedisConfigured) {
|
||||||
const redis = new Redis(cfg.REDIS_URL);
|
// const redis = new Redis(cfg.REDIS_URL);
|
||||||
try {
|
// try {
|
||||||
await redis.ping();
|
// await redis.ping();
|
||||||
redis.disconnect();
|
// redis.disconnect();
|
||||||
} catch (err) {
|
// } catch (err) {
|
||||||
logger.error("Health check: redis connection failed", err);
|
// logger.error("Health check: redis connection failed", err);
|
||||||
return reply.code(503).send({
|
// return reply.code(503).send({
|
||||||
date: new Date(),
|
// date: new Date(),
|
||||||
message: "Service unavailable"
|
// message: "Service unavailable"
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
return {
|
return {
|
||||||
date: new Date(),
|
date: new Date(),
|
||||||
|
|||||||
Reference in New Issue
Block a user