# HG changeset patch # User Matthew Wild # Date 1521220329 0 # Node ID 9901deadc06866c2088cfbcb9c188f446ecd38dd # Parent ce5b16e135738c86e1717bab23da8b0158693fbf util.async: Fix order of statements so queue count makes more sense diff -r ce5b16e13573 -r 9901deadc068 util/async.lua --- a/util/async.lua Fri Mar 16 17:11:23 2018 +0000 +++ b/util/async.lua Fri Mar 16 17:12:09 2018 +0000 @@ -108,8 +108,8 @@ -- Add a task item for the runner to process function runner_mt:run(input) if input ~= nil then + table.insert(self.queue, input); self:log("debug", "queued new work item, %d items queued", #self.queue); - table.insert(self.queue, input); end if self.state ~= "ready" then -- The runner is busy. Indicate that the task item has been @@ -176,6 +176,7 @@ -- 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, ...)