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

configurable polling of server-side events #187

Open
jvanasco opened this issue Oct 10, 2014 · 1 comment
Open

configurable polling of server-side events #187

jvanasco opened this issue Oct 10, 2014 · 1 comment

Comments

@jvanasco
Copy link
Contributor

The constant polling of the debugtoolbar has made debugging certain things difficult.

I tried turning off logging, but that was too strict a measure.

I'd like to suggest a configurable polling option.

Looking at the code, toolbar.dbtmako just uses a javascript EventSource to handle the ajax data

source = new EventSource('/_debug_toolbar/sse?request_id=${request_id}');

looking at views.py , it's seems that we're not really using a server-side push, but falling back on the HTML spec that will have browsers repoll/reconnect/retry in 3second intervals

The current template for the payload is:

U_SSE_PAYLOAD = text_("id:{0}\nevent: new_request\ndata:{1}\n\n")

And we can minimally edit that to have full control of the retry (in ms)

U_SSE_PAYLOAD = text_("id:{0}\nevent: new_request\ndata:{1}\n\nretry: {2}\n\n")

The default behavior is equivalent to 3000 ; a simple config file edit could let this be 60,000 or 1,000 or whatever is easiest for a developer.

@mmerickel
Copy link
Member

If you want to provide a patch to modify the polling interval that would be fine.

Presumably a debugtoolbar.refresh_interval ini setting that defaulted to the current 1000ms.

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

2 participants