luci-base: xhr: increase poll request timeout
Some status requests can take quite some time to finish, the LuCI DSL status information in particular. Since the polling loop code already takes care of not relaunching requests which are already running, increase the per iteration timeout to up to five times the poll interval. This should be sufficient to let most operations complete. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
parent
053682c4c3
commit
b38306dcee
1 changed files with 1 additions and 1 deletions
|
@ -190,7 +190,7 @@ XHR.poll = function(interval, url, data, callback, post)
|
||||||
for (var i = 0, e = XHR._q[0]; i < XHR._q.length; e = XHR._q[++i])
|
for (var i = 0, e = XHR._q[0]; i < XHR._q.length; e = XHR._q[++i])
|
||||||
{
|
{
|
||||||
if (!(XHR._t % e.interval) && !e.xhr.busy())
|
if (!(XHR._t % e.interval) && !e.xhr.busy())
|
||||||
e.xhr[post ? 'post' : 'get'](e.url, e.data, e.callback, e.interval * 1000 - 5);
|
e.xhr[post ? 'post' : 'get'](e.url, e.data, e.callback, e.interval * 1000 * 5 - 5);
|
||||||
}
|
}
|
||||||
|
|
||||||
XHR._t++;
|
XHR._t++;
|
||||||
|
|
Loading…
Reference in a new issue