L
L
Loyxim2020-11-06 12:35:10
Python
Loyxim, 2020-11-06 12:35:10

Endless running of python code anyway?

I hosted a small vk bot on python anyware. Due to the LongPoll feature, a ReadTimeOut error is thrown. I was told that a longpoll connection cannot be kept indefinitely. The question is, how can you endlessly restart the code with a bot on a python hosting anyware?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
kolya2_romanov, 2020-11-06
@kolya2_romanov

Catching an exception and re-establishing a connection, I also know from my own experience that PythonAnywhere on a free plan reboots the host daily (probably so that it doesn’t work 24/7 for free), they write about this in the FAQ.

S
Semyon, 2020-11-06
@Hitreno

I don’t know for sure about VK and python anywhere, but telegram bots on the server began to work stably when I replaced polling (LongPool in your case) with webhooks

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question