mirror of
https://github.com/OneUptime/oneuptime
synced 2024-11-21 06:40:39 +00:00
Add logging for infrastructure status checks in Status.ts
This commit is contained in:
parent
b14f918d59
commit
972e6cb98f
@ -1,4 +1,5 @@
|
||||
// This class checks the status of all the datasources.
|
||||
import logger from "../Utils/Logger";
|
||||
import { ClickhouseAppInstance } from "./ClickhouseDatabase";
|
||||
import PostgresAppInstance from "./PostgresDatabase";
|
||||
import Redis from "./Redis";
|
||||
@ -10,22 +11,33 @@ export default class InfrastructureStatus {
|
||||
checkPostgresStatus: boolean;
|
||||
checkClickhouseStatus: boolean;
|
||||
}): Promise<void> {
|
||||
logger.debug("Checking infrastructure status");
|
||||
|
||||
if (data.checkRedisStatus) {
|
||||
logger.debug("Checking Redis status");
|
||||
if (!(await Redis.checkConnnectionStatus())) {
|
||||
logger.debug("Redis is not connected");
|
||||
throw new DatabaseNotConnectedException("Redis is not connected");
|
||||
}
|
||||
logger.debug("Redis is connected");
|
||||
}
|
||||
|
||||
if (data.checkPostgresStatus) {
|
||||
logger.debug("Checking Postgres status");
|
||||
if (!(await PostgresAppInstance.checkConnnectionStatus())) {
|
||||
logger.debug("Postgres is not connected");
|
||||
throw new DatabaseNotConnectedException("Postgres is not connected");
|
||||
}
|
||||
logger.debug("Postgres is connected");
|
||||
}
|
||||
|
||||
if (data.checkClickhouseStatus) {
|
||||
logger.debug("Checking Clickhouse status");
|
||||
if (!(await ClickhouseAppInstance.checkConnnectionStatus())) {
|
||||
logger.debug("Clickhouse is not connected");
|
||||
throw new DatabaseNotConnectedException("Clickhouse is not connected");
|
||||
}
|
||||
logger.debug("Clickhouse is connected");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user