Update tg issues

This commit is contained in:
xCyanGrizzly
2026-03-16 16:51:30 +01:00
parent 2763de2711
commit d7bbb7587e
13 changed files with 450 additions and 70 deletions

View File

@@ -36,11 +36,13 @@ async function main(): Promise<void> {
// Graceful shutdown
function shutdown(signal: string): void {
log.info({ signal }, "Shutdown signal received");
stopScheduler();
// Stop accepting new work
stopFetchListener();
// Close DB connections
Promise.all([db.$disconnect(), pool.end()])
// Wait for any active cycle to finish before closing DB
stopScheduler()
.then(() => Promise.all([db.$disconnect(), pool.end()]))
.then(() => {
log.info("Shutdown complete");
process.exit(0);