Page 1 of 1

using a higher AJAX timeout

Posted: Fri Apr 15, 2022 8:07 am
by mhstar89
Hey guys,

Is it possible somehow to specify a timeout for the AJAX requests?
Especially with a bunch of events, I manage to get into a state where I cannot review *any* events, even though the server reply comes fine (just a bit too late apparently). The AJAX request fails with "timeout" then, gets repeated, just to fail with a "timeout" again and again and again (as long as you let it run).

I can hack a fix right into the /var/cache/zoneminder/cache/skins_classic_views_js_events-dark-1649113633.js file, which immediately solves my issue:

Instead of the line

Code: Select all

$j.getJSON(thisUrl + '?view=request&request=events&task=query'+filterQuery, params.data)
I write

Code: Select all

$j.ajax({
    dataType: "json",
    url: thisUrl + '?view=request&request=events&task=query'+filterQuery,
    data: params.data,
    timeout: 50000
})
Everything else (including the done/fail callbacks) remains the same.

Is there a better way of doing it, or can this change find its way into mainstream? Because without the change, Zoneminder is pretty much unusable for me on this installation (because I cannot review any events), whereas with the change everything is fine.
Since getJSON is a shorthand for the ajax call I do, and I just also specify the timeout, this shouldn't break anything.

Thanks,
Michael

Re: using a higher AJAX timeout

Posted: Sun Apr 17, 2022 12:25 pm
by knight-of-ni
Ajax timeout is found under the bandwidth options