telebotter / django-telegrambot

Simple app for Telegram bot in Django
BSD 3-Clause "New" or "Revised" License
14 stars 7 forks source link

Warning "Asynchronous callbacks can not be processed without at least one worker thread" when runngin commands #18

Open autoantwort opened 3 years ago

autoantwort commented 3 years ago

We are getting the warning

/venv/lib/python3.7/site-packages/telegram/ext/dispatcher.py:251: UserWarning: Asynchronous callbacks can not be processed without at least one worker thread.
 'Asynchronous callbacks can not be processed without at least one worker thread.'

every time a cron jobs executes a command in production. So we currently getting 1440 cron job mails a day :D

Is there a way to disable this or why we get this error in general, locally I don't get this error?

Can we prevent that all the telegrambot_handlers.py gets loaded when a command gets executed?

Thanks in advance :)

autoantwort commented 3 years ago

As a workaround we now run python manage.py botpolling --username=MainBot & at the server, but that is not very nice