fixed monitor api polling
Build and Push Docker Images / detect-changes (push) Successful in 10s
Build and Push Docker Images / build-auth-api (push) Successful in 1m6s
Build and Push Docker Images / build-employee-api (push) Successful in 1m2s
Build and Push Docker Images / build-transit-api (push) Successful in 58s
Build and Push Docker Images / build-error-log-api (push) Successful in 1m10s
Build and Push Docker Images / build-admin-ui (push) Successful in 1m15s
Build and Push Docker Images / build-monitoring-ui (push) Successful in 1m16s
Build and Push Docker Images / deploy-test-node (push) Successful in 4s
Build and Push Docker Images / detect-changes (push) Successful in 10s
Build and Push Docker Images / build-auth-api (push) Successful in 1m6s
Build and Push Docker Images / build-employee-api (push) Successful in 1m2s
Build and Push Docker Images / build-transit-api (push) Successful in 58s
Build and Push Docker Images / build-error-log-api (push) Successful in 1m10s
Build and Push Docker Images / build-admin-ui (push) Successful in 1m15s
Build and Push Docker Images / build-monitoring-ui (push) Successful in 1m16s
Build and Push Docker Images / deploy-test-node (push) Successful in 4s
This commit is contained in:
@@ -91,18 +91,13 @@ app.post("/createemployee", async (req, res) => {
|
||||
}
|
||||
});
|
||||
|
||||
app.get("/health", async (_req, res, _next) => {
|
||||
app.get("/health", async (_req, res) => {
|
||||
try {
|
||||
return res.status(200).json({ endpoint: "reachable" });
|
||||
await db.query("SELECT 1");
|
||||
return res.status(200).json({ endpoint: "reachable", database: "ok" });
|
||||
} catch (err) {
|
||||
void reportError({
|
||||
partofservice: `${req.method} ${req.originalUrl}`,
|
||||
error: err?.stack || err?.message || String(err),
|
||||
});
|
||||
console.error(err);
|
||||
res
|
||||
.status(500)
|
||||
.json({ endpoint: "unreachable", error: friendlyErrorMessage(500) });
|
||||
res.status(503).json({ endpoint: "unreachable", database: "down" });
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user