1
0
Fork 0
mirror of https://github.com/muerwre/vk-tg-bot.git synced 2025-04-24 22:46:41 +07:00

#6 added logger info for failed healthcheck

This commit is contained in:
Fedor Katurov 2021-05-13 14:09:30 +07:00
parent 2c5f111c56
commit 814f1ade78
2 changed files with 12 additions and 2 deletions

View file

@ -133,6 +133,11 @@ export class PostgresDB implements Storage {
};
healthcheck = async () => {
await this.connection.query("SELECT 1");
try {
await this.connection.query("SELECT 1");
} catch (e) {
logger.warn("health check failed at db", e);
throw e;
}
};
}

View file

@ -116,6 +116,11 @@ export class TelegramService {
* Performs healthcheck for telegram
*/
public healthcheck = async () => {
await this.bot.telegram.getMe();
try {
await this.bot.telegram.getMe();
} catch (e) {
logger.warn("health check failed at telegram", e);
throw e;
}
};
}