fix bot heathcheck
Deploy app frontend / app frontend (push) Successful in 2m44s
Deploy service couchdb / service couchdb (push) Successful in 27s
Deploy db-migrations / db-migrations (push) Successful in 1m41s
Deploy service tg-bot / service tg-bot (push) Successful in 1m49s
Deploy service message-delivery-method-web-push / service message-delivery-method-web-push (push) Successful in 1m35s
Deploy app frontend / app frontend (push) Successful in 2m44s
Deploy service couchdb / service couchdb (push) Successful in 27s
Deploy db-migrations / db-migrations (push) Successful in 1m41s
Deploy service tg-bot / service tg-bot (push) Successful in 1m49s
Deploy service message-delivery-method-web-push / service message-delivery-method-web-push (push) Successful in 1m35s
This commit is contained in:
@@ -43,22 +43,20 @@ export function startHealthServer(
|
||||
}
|
||||
});
|
||||
|
||||
const { promise, resolve, reject } = Promise.withResolvers<void>();
|
||||
server.once("error", reject);
|
||||
server.listen(port, hostname, resolve);
|
||||
return new Promise<void>((resolve, reject) => {
|
||||
server.once("error", reject);
|
||||
server.listen(port, hostname, () => {
|
||||
resolve();
|
||||
console.log(
|
||||
`Healthcheck server running on http://${hostname}:${port}/health`,
|
||||
);
|
||||
});
|
||||
|
||||
promise.then(() => {
|
||||
console.log(
|
||||
`Healthcheck server running on http://${hostname}:${port}/health`,
|
||||
);
|
||||
// Закрываем сервер при активации AbortController
|
||||
controller.signal.addEventListener("abort", () => {
|
||||
console.log("Healthcheck server shutting down due to abort signal.");
|
||||
reject();
|
||||
server.close();
|
||||
});
|
||||
});
|
||||
|
||||
// Закрываем сервер при активации AbortController
|
||||
controller.signal.addEventListener("abort", () => {
|
||||
console.log("Healthcheck server shutting down due to abort signal.");
|
||||
reject();
|
||||
server.close();
|
||||
});
|
||||
|
||||
return promise;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user