1 files changed, 4 insertions, 8 deletions
diff --git a/api/src/routes/-/readyz.ts b/src/api/routes/-/readyz.ts
index f7bcfebf..d9d1c026 100644
--- a/api/src/routes/-/readyz.ts
+++ b/src/api/routes/-/readyz.ts
@@ -1,17 +1,13 @@
import { Router, Response, Request } from "express";
import { route } from "@fosscord/api";
-import { getConnection } from "typeorm";
+import { getDatabase } from "@fosscord/util";
const router = Router();
router.get("/", route({}), (req: Request, res: Response) => {
- try {
- // test that the database is alive & responding
- getConnection();
- return res.sendStatus(200);
- } catch (e) {
- res.sendStatus(503);
- }
+ if (!getDatabase()) return res.sendStatus(503);
+
+ return res.sendStatus(200);
});
export default router;
|