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:
parent
2c5f111c56
commit
814f1ade78
2 changed files with 12 additions and 2 deletions
|
@ -133,6 +133,11 @@ export class PostgresDB implements Storage {
|
||||||
};
|
};
|
||||||
|
|
||||||
healthcheck = async () => {
|
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;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -116,6 +116,11 @@ export class TelegramService {
|
||||||
* Performs healthcheck for telegram
|
* Performs healthcheck for telegram
|
||||||
*/
|
*/
|
||||||
public healthcheck = async () => {
|
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;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue