8000 [WebProfilerBundle] Increase retry delays between toolbarAction ajax calls by JoeKre · Pull Request #25967 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[WebProfilerBundle] Increase retry delays between toolbarAction ajax calls #25967

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

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
increase retry delays between toolbarAction ajax calls
  • Loading branch information
JoeKre committed Jan 30, 2018
commit 407601cb26c1290c02c94726ad96e35878e54f4f
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
var xhr = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP');
options = options || {};
options.maxTries = options.maxTries || 0;
options.retryDelay = options.retryDelay || 500;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need to make this an option IMO. Just change the hardcoded 500 value in the setTimeout call.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Guess that would be fine since since the maxTries is only used for loading the toolbar data at least as far as i see it. Therefor i went with extending and keeping the default behaviour unless told otherwise. I'll update the pr

xhr.open(options.method || 'GET', url, true);
xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
xhr.onreadystatechange = function(state) {
Expand All @@ -39,7 +40,7 @@
setTimeout(function(){
options.maxTries--;
request(url, onSuccess, onError, payload, options);
}, 500);
}, options.retryDelay);

return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
sfwdt.setAttribute('class', 'sf-toolbar sf-error-toolbar');
}
},
{ maxTries: 5 }
{ maxTries: 5, timeoutDelay: 1000 }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

timeoutDelay here, while it's retryDelay the other way around? :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just fixed it this minute. stupid mistake

);
})();
/*]]>*/</script>
0