Open mike0sv opened 6 years ago
I don't know how celery works, but the following few points are true for sure:
You cannot have more than one program calling message_loop()
on the same token, because Telegram does not allow multiple processes to poll on the same token.
You can have many programs sending things using the same token.
ReadTimeoutError and how long it takes to send something, these are problems that are hard for me to say exactly why. It could be the network or Telegram servers. Without investigating further, it's hard to say where the real problem lies.
Basically, when you use celery tasks, instead of direct call, it serializes them and puts into queue (external broker like rabbitmq or redis). Then you start your celery worker, which is a python process that imports the same code, takes tasks from queue and runs them. It can utilize pool of threads or processes (processes in my case). So,
Hi! I use telepot with celery to process updates asynchronously, and noticed some strange behavior/errors. For example, sometimes .editMessageReplyMarkup fails with ReadTimeoutError, which is 30 seconds. And sometimes .sendPhoto takes >10 seconds to execute. My question is, is it because celery runs multiple processes, so multiple instances of same bot runs on one machine or something like this?
minimal code example is like this