F
F
fuckingfamouscoder2020-05-23 14:59:49
Python
fuckingfamouscoder, 2020-05-23 14:59:49

The TelegramBotApi bot crashes every half an hour, what should I do?

Good afternoon, I'm writing bots on pytelegrambotapi I'm
already buying the third VDS server, I'm using a bot, and suddenly I see a crash in the console log
And so constantly, the bot is standing, half an hour or an hour passes, and CRASH!
Server configurations are outrageous for this kind of bot, Windows Server R2012
100 Mbps port, 2 cores and 2 GB of RAM
What should I do? Please tell me, I have been unable to submit the project for the third day because of this :(
5ec90fa3615c4877019627.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Igor Makhov, 2020-05-23
@fuckingfamouscoder

Set the bot to infinite restart:

while True:
    try:
        bot.polling(none_stop=True)
    except Exception as ex:
        logger.error(ex)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question