-
-
Notifications
You must be signed in to change notification settings - Fork 531
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
Periodic callback don't stop in Django #1125
Comments
I think it is a bug that PeriodicCallback is running "forever" with Django when the user closes the browser without pressing the stop button. I seems to be related to |
The problem stills is still here with newer versions of Panel (0.10.0a6) and Bokeh (2.1.0). Updated code. I have screen recorded the problem to show the how Panel stops after 30 seconds of closing the browser and Django keeps running forever. I have attached the screen recordings periodic_videos.zip and converted them to Gif: |
Sounds like the server cleanup handlers aren't correctly triggered when running via Django. It's likely we'll have to fix this upstream in Bokeh. |
Could see their had been some updates with periodic callbacks in #1507 so I tried to see if it had solved the problem. Unfortunately it did not solve it but then again it was a long shot. I was running version Also looked into Bokeh´s Django implementation and found out I could register a window/tab closing with the function |
I have found out I can get the periodic callback to stop by changing the following lines from:
to:
Maybe this could be the solution to my problem? I have not a Bokeh development environment setup on my computer, so I have not ran any of their tests. |
Ooh, yeah that seems like it would work. Maybe just submit a PR and we can discuss and further test it from there. |
Fixed upstream in bokeh/bokeh#10578 |
ALL software version info
Python 3.7.6
Panel 8.0
Bokeh 1.4.0
Django 3.0.3
Channels 2.4.0
Windows 10
Description of expected behavior and the observed behavior
I'm trying to create a Django site which have a widget with a periodic callback, so a plot is updated every 10 seconds. In principle I have combined two of your examples a Django example and a periodic callback example.
I have got this work both with Django's
python manage.py runserver
and Panel'spanel serve panel_example.py
. But I have noticed that when I leave the site without stopping the periodic callback with the widget itself that it keeps running forever in Django, where Panel is running for ~30 seconds. Is there a way to get Django to work like Panel and only run for a small amount of time after a user leave the site?I have very limited experience with Django and Bokeh interaction so it could be that I'm missing something very obvious or there are better alternatives to what I'm doing.
Complete, minimal, self-contained example code that reproduces the issue
See periodic_example.zip with an example of the problem, I'm using the commands mentioned above to start Django or Panel. I'm printing the current time when the function with a periodical callback is called.
The text was updated successfully, but these errors were encountered: