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:
@@ -46,7 +46,7 @@ jobs:
|
||||
run: TG_BOT_TAG=commit-${{env.GITHUB_SHA}} docker compose -p hereconnect build tg-bot
|
||||
|
||||
- name: start container
|
||||
run: TG_BOT_TAG=commit-${{env.GITHUB_SHA}} docker compose -p hereconnect up -d --pull never --wait tg-bot
|
||||
run: TG_BOT_DEBUG='grammy*' TG_BOT_TAG=commit-${{env.GITHUB_SHA}} docker compose -p hereconnect up -d --pull never --wait tg-bot
|
||||
|
||||
- name: rename to latest
|
||||
run: docker tag hereconnect/service-tg-bot:commit-${{env.GITHUB_SHA}} hereconnect/service-tg-bot:latest
|
||||
@@ -57,6 +57,6 @@ jobs:
|
||||
COUCHDB_TAG: latest
|
||||
run: docker compose -p hereconnect up -d --pull never --wait tg-bot
|
||||
|
||||
# - name: cleanup docker image
|
||||
# if: always()
|
||||
# run: docker rmi hereconnect/service-tg-bot:commit-${{env.GITHUB_SHA}}
|
||||
- name: cleanup docker image
|
||||
if: always()
|
||||
run: docker rmi hereconnect/service-tg-bot:commit-${{env.GITHUB_SHA}}
|
||||
|
||||
@@ -70,6 +70,7 @@ services:
|
||||
- API_URL=http://${COUCHDB_USER}:${COUCHDB_PASSWORD}@couchdb:5984
|
||||
- BOT_TOKEN=${BOT_TOKEN:-}
|
||||
- READ_BASE_URL=${READ_BASE_URL:-}
|
||||
- DEBUG=${TG_BOT_DEBUG:-}
|
||||
depends_on:
|
||||
couchdb:
|
||||
condition: service_healthy
|
||||
|
||||
@@ -43,11 +43,10 @@ export function startHealthServer(
|
||||
}
|
||||
});
|
||||
|
||||
const { promise, resolve, reject } = Promise.withResolvers<void>();
|
||||
return new Promise<void>((resolve, reject) => {
|
||||
server.once("error", reject);
|
||||
server.listen(port, hostname, resolve);
|
||||
|
||||
promise.then(() => {
|
||||
server.listen(port, hostname, () => {
|
||||
resolve();
|
||||
console.log(
|
||||
`Healthcheck server running on http://${hostname}:${port}/health`,
|
||||
);
|
||||
@@ -59,6 +58,5 @@ export function startHealthServer(
|
||||
reject();
|
||||
server.close();
|
||||
});
|
||||
|
||||
return promise;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ bot.on("callback_query:data", callbackQueryHandler);
|
||||
await setupCommands(bot);
|
||||
|
||||
// Запуск бота
|
||||
await bot.start();
|
||||
bot.start();
|
||||
|
||||
await startHealthServer(abortController);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user