Stop running HTTP GET requests if the client disconnects

For example, this avoids running too many queries on InfluxDB in parallel when the user clicks multiple items in the gui
This commit is contained in:
emanuele-f 2018-12-14 19:49:53 +01:00
parent 14c68a5b21
commit d48eb6def0
4 changed files with 50 additions and 1 deletions

View file

@ -82,7 +82,7 @@ local function influx_query(base_url, query, username, password, options)
return nil
end
if res.RESPONSE_CODE ~= 200 then
if((res.RESPONSE_CODE ~= 200) and (not res.IS_PARTIAL)) then
traceError(TRACE_ERROR, TRACE_CONSOLE, "Bad response code[" .. res.RESPONSE_CODE .. "]: " .. (res.CONTENT or ""))
return nil
end