Skip to content
Snippets Groups Projects
Commit e9c9832a authored by Serge Petrenko's avatar Serge Petrenko Committed by Kirill Yukhin
Browse files

feedback_daemon: generate report right before sending

Feedback daemon used to generate report before waiting (for an hour by
default) until it's time to send it. Better actualize the reports and
generate them right when it's time to send them.

Part of #5750
parent bc15e0f0
No related branches found
No related tags found
No related merge requests found
......@@ -333,16 +333,17 @@ local function feedback_loop(self)
fiber.name(PREFIX, { truncate = true })
while true do
local feedback = self:generate_feedback()
local msg = self.control:get(self.interval)
-- if msg == "send" then we simply send feedback
if msg == "stop" then
break
elseif feedback ~= nil then
if is_first_send then
fiber.sleep(10)
is_first_send = nil
end
end
if is_first_send then
fiber.sleep(10)
is_first_send = nil
end
local feedback = self:generate_feedback()
if feedback ~= nil then
pcall(http.post, self.host, json.encode(feedback), {timeout=1})
end
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment