[Tarantool-patches] [PATCH v2 4/5] feedback_daemon: generate report right before sending

Serge Petrenko sergepetrenko at tarantool.org
Sat Apr 10 18:03:47 MSK 2021



10.04.2021 00:53, Vladislav Shpilevoy пишет:
> Thanks for the patch!
>
> On 08.04.2021 15:38, Serge Petrenko via Tarantool-patches wrote:
>> 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.
> Now there is the 10 seconds delay for the first send. Maybe worth
> generating the feedback after the sleep on Mac.
Sure, thanks for noticing!

Incremental diff:
=====================================

diff --git a/src/box/lua/feedback_daemon.lua 
b/src/box/lua/feedback_daemon.lua
index 93bbb2a11..64460f5f4 100644
--- a/src/box/lua/feedback_daemon.lua
+++ b/src/box/lua/feedback_daemon.lua
@@ -338,12 +338,12 @@ local function feedback_loop(self)
          if msg == "stop" then
              break
          end
+        if is_first_send then
+            fiber.sleep(10)
+            is_first_send = nil
+        end
          local feedback = self:generate_feedback()
          if feedback ~= nil then
-            if is_first_send then
-                fiber.sleep(10)
-                is_first_send = nil
-            end
              pcall(http.post, self.host, json.encode(feedback), 
{timeout=1})
          end
      end

-- 
Serge Petrenko



More information about the Tarantool-patches mailing list