mirror of
https://github.com/abocn/TelegramBot.git
synced 2025-03-10 12:49:57 +00:00
Fixed shutdown handling
This commit is contained in:
parent
e3a2fbcc78
commit
c91ce23f66
@ -51,10 +51,8 @@ const startBot = async () => {
|
|||||||
|
|
||||||
const handleShutdown = (signal) => {
|
const handleShutdown = (signal) => {
|
||||||
console.log(`Received ${signal}. Stopping bot...`);
|
console.log(`Received ${signal}. Stopping bot...`);
|
||||||
bot.stop(signal).then(() => {
|
bot.stop(signal);
|
||||||
console.log('Bot stopped.');
|
process.exit(0);
|
||||||
process.exit(0);
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
process.once('SIGINT', () => handleShutdown('SIGINT'));
|
process.once('SIGINT', () => handleShutdown('SIGINT'));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user