From 359f425e7178855ec096452338896595a4f16a6f Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Fri, 16 Mar 2018 17:12:09 +0000 Subject: util.async: Fix order of statements so queue count makes more sense --- util/async.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'util') diff --git a/util/async.lua b/util/async.lua index eac74c1d..e5f12f28 100644 --- a/util/async.lua +++ b/util/async.lua @@ -108,8 +108,8 @@ end -- Add a task item for the runner to process function runner_mt:run(input) if input ~= nil then - self:log("debug", "queued new work item, %d items queued", #self.queue); table.insert(self.queue, input); + self:log("debug", "queued new work item, %d items queued", #self.queue); end if self.state ~= "ready" then -- The runner is busy. Indicate that the task item has been @@ -176,6 +176,7 @@ end -- Add a task item to the queue without invoking the runner, even if it is idle function runner_mt:enqueue(input) table.insert(self.queue, input); + self:log("debug", "queued new work item, %d items queued", #self.queue); end function runner_mt:log(level, fmt, ...) -- cgit v1.2.3