-
-
Notifications
You must be signed in to change notification settings - Fork 32
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
Possible to add a delay to reload page? #299
Comments
Why do you get an error? #222 adds a “debounce” - a timer that also groups reloads across the time frame. I think we should add that by default, perhaps 500ms or so. But the PR needs work. |
Testing with it more, it might partially be an error with an extra proxy-server/process manager I use in front of django. Having just a bit of delay seems to fix it for my case, but I will keep testing. Having a small delay like in #222 would likely avoid my issue. I will take a look at that PR and see what they did (I did a local test where I just naively added 1 second delay) |
Experiencing this exact scenario while using this package + django-components. Just slow enough to get a CONNECTION_RESET followed by the reloaded page |
Description
This plugin works almost out of the box for me, doing exactly what is advertised, but triggers a reload too fast and I get a 500.
Since the script tag reads in the dataset entry
https://github.com/adamchainz/django-browser-reload/blob/main/src/django_browser_reload/static/django-browser-reload/reload-listener.js#L4
I'm wondering if it would be possible to add a django setting for a default timeout, that gets passed through a
data-timeout
(or similar) attribute, and then add an extra sleep statement to the reload section.django-browser-reload/src/django_browser_reload/static/django-browser-reload/reload-listener.js
Lines 16 to 18 in d192774
Does that sound like something reasonable to do as a pull request ?
The text was updated successfully, but these errors were encountered: