From fd381c6b8d0788dd5cf7506526caf530d15cc028 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/async.lua') 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