django-telegrambot
django-telegrambot copied to clipboard
The bot is executed every time a command manage.py is run
In my django installation it seems that when I run python manage.py my-command
, the bot is started again: in fact, I see the log "Loading handlers for telegram bot".
How is that possible?
This is normal in Django, manage.py reload every installed app included django-telegrambot.
Well, maybe someone wants to execute a setup() only once... I solved by setting a cache/file to be checked every time.
I think can be nice. If you wanna share your solution send a pull request.
Has there been any progress regarding that issue? I am facing the same problem.
I don't call it issue. Why the django's modules reloading is a problem for you?
The issue is that django-telegram sends webhook requests to the Telegram servers every time the module is started.
I don't want the app to fire setWebhook requests every time I execute a manage.py command (especially, if it is already running as a server in parallel).
Happy to comment in more detail if needed.
On Thu, 17 May 2018, 12:23 JungDev, [email protected] wrote:
I don't call it issue. Why the django's modules reloading is a problem for you?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/JungDev/django-telegrambot/issues/14#issuecomment-389803234, or mute the thread https://github.com/notifications/unsubscribe-auth/AIYGn3IFLudJztkSxk_FuFrie1FHS194ks5tzUGFgaJpZM4SKfJb .
Django operate a reload of all installed app, and I can't change this. I think that better way to not send a webhook setting request at every reload is add a check in code if something is changed in webhook state (url, certificate,timeout, max_connections and allowed_updates), but this means make anyway a getWebhookInfo request to telegram's server everytime and this method don't give back any info about timeout and which certificate is setted.
Do you think that is better than now?
Hi all, any news about that?