mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 07:29:32 +00:00
Add POST timeout to prevent housekeeping from blocking indefinitely
This commit is contained in:
parent
828ee884ff
commit
44abcd442c
5 changed files with 22 additions and 6 deletions
|
|
@ -220,7 +220,7 @@ end
|
|||
-- ########################################################
|
||||
|
||||
function callback_utils.uploadTSdata()
|
||||
local url = ntop.getCache("ntopng.prefs.ts_post_data_url")
|
||||
local url = ntop.getPref("ntopng.prefs.ts_post_data_url")
|
||||
|
||||
if((url == nil) or (url == "")) then
|
||||
return
|
||||
|
|
@ -243,7 +243,7 @@ function callback_utils.uploadTSdata()
|
|||
|
||||
-- Delete the file after POST
|
||||
local delete_file_after_post = true
|
||||
ret = ntop.postHTTPTextFile("", "", url .. "/write?db=ntopng", fname, delete_file_after_post)
|
||||
ret = ntop.postHTTPTextFile("", "", url .. "/write?db=ntopng", fname, delete_file_after_post, 5 --[[ timeout ]])
|
||||
--print(fname .. "\n")
|
||||
|
||||
if(ret ~= true) then
|
||||
|
|
@ -251,6 +251,7 @@ function callback_utils.uploadTSdata()
|
|||
|
||||
-- delete the file manually
|
||||
os.remove(fname)
|
||||
break
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue