Skip to content

Conversation

@tiagonapoli
Copy link

Possible fix to #474, #453, #399. Connection Reset by Peer, ReadTimeOut:

  • I noticed that connection reset by peer maybe could be solved by resetting the requests.session(). ReadTimeOut too maybe can be solved by resetting it. So, when a request is made and a exception is captured, the session is resetted and a retry is done. Retries limit was set to 5.

Made an alternate solution to #481:

  • Made polling_thread an instance variable: since if Telebot is threaded, maybe is for the best to limit polling_thread instances to just one.
  • The function stop_instance disables the Telebot instance (since it closes the worker_pool its threads can't be restarted), but it grants that the polling_thread is closed too, if some unhandled exception happened on _threaded_polling and the self.polling_thread wasn't closed.
  • In WorkerThread's stop() function, added a self.continue_event.set(), just to make sure that the thread will get out of the while self._running: loop (could the thread be stuck on the self.continue_event.wait()?).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants