Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The bot is executed every time a command manage.py is run #14

Open
drago-96 opened this issue Feb 19, 2018 · 8 comments
Open

The bot is executed every time a command manage.py is run #14

drago-96 opened this issue Feb 19, 2018 · 8 comments

Comments

@drago-96
Copy link

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?

@JungDev
Copy link
Owner

JungDev commented Feb 21, 2018

This is normal in Django, manage.py reload every installed app included django-telegrambot.

@drago-96
Copy link
Author

Well, maybe someone wants to execute a setup() only once...
I solved by setting a cache/file to be checked every time.

@JungDev
Copy link
Owner

JungDev commented Feb 28, 2018

I think can be nice. If you wanna share your solution send a pull request.

@alephyud
Copy link

Has there been any progress regarding that issue? I am facing the same problem.

@JungDev
Copy link
Owner

JungDev commented May 17, 2018

I don't call it issue. Why the django's modules reloading is a problem for you?

@alephyud
Copy link

alephyud commented May 17, 2018 via email

@JungDev
Copy link
Owner

JungDev commented May 17, 2018

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?

@rocchidavide
Copy link

Hi all, any news about that?

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

No branches or pull requests

4 participants