You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
#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.
While testing it again directly with django runserver, I have trouble getting it to trigger, but when behind my proxy-server, it is just slow enough to cause the proxy server to throw the equivilant of a 500/502.
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)
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: