fix(api): use ping instead of keys for healtcheck
This commit is contained in:
@@ -21,7 +21,7 @@ export async function healthcheck(
|
|||||||
request: FastifyRequest,
|
request: FastifyRequest,
|
||||||
reply: FastifyReply,
|
reply: FastifyReply,
|
||||||
) {
|
) {
|
||||||
const redisRes = await withTimings(getRedisCache().keys('op:buffer:*'));
|
const redisRes = await withTimings(getRedisCache().ping());
|
||||||
const dbRes = await withTimings(db.project.findFirst());
|
const dbRes = await withTimings(db.project.findFirst());
|
||||||
const queueRes = await withTimings(eventsQueue.getCompleted());
|
const queueRes = await withTimings(eventsQueue.getCompleted());
|
||||||
const chRes = await withTimings(
|
const chRes = await withTimings(
|
||||||
@@ -34,7 +34,7 @@ export async function healthcheck(
|
|||||||
reply.status(status).send({
|
reply.status(status).send({
|
||||||
redis: redisRes
|
redis: redisRes
|
||||||
? {
|
? {
|
||||||
ok: !!redisRes.data.length,
|
ok: redisRes.data === 'PONG',
|
||||||
time: `${redisRes.time}ms`,
|
time: `${redisRes.time}ms`,
|
||||||
}
|
}
|
||||||
: null,
|
: null,
|
||||||
|
|||||||
Reference in New Issue
Block a user