Unknown error in HTTP implementation: RuntimeError('Event loop is closed') #4096
-
Hi, I run:
once the thread is completed I type /start and I am receiving th following error:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 8 replies
-
Hi these kinds of errors are a common symptom of mixing asyncio and threading. Before attempting to solve them: Why are trying to use a thread? |
Beta Was this translation helpful? Give feedback.
-
The function send_telegram generates a photo and sends it to the chat. The generation of the photo takes 15-20s. I am using a thread because I want that the bot continue receiving an processing requests. If i do not use a thread the bot will be freezed during 15-20s |
Beta Was this translation helpful? Give feedback.
https://docs.python.org/3.11/library/asyncio-eventloop.html#asyncio.loop.run_in_executor