diff --git a/lib/qless/lua/qless-lib.lua b/lib/qless/lua/qless-lib.lua index b8daf8b0..42bce512 100644 --- a/lib/qless/lua/qless-lib.lua +++ b/lib/qless/lua/qless-lib.lua @@ -33,9 +33,9 @@ QlessRecurringJob.__index = QlessRecurringJob Qless.config = {} -- Extend a table. This comes up quite frequently -function table.extend(self, other) +local function extend_table(target, other) for i, v in ipairs(other) do - table.insert(self, v) + table.insert(target, v) end end @@ -1522,7 +1522,7 @@ function QlessQueue:peek(now, count) -- With these in place, we can expand this list of jids based on the work -- queue itself and the priorities therein - table.extend(jids, self.work.peek(count - #jids)) + extend_table(jids, self.work.peek(count - #jids)) return jids end @@ -1597,7 +1597,7 @@ function QlessQueue:pop(now, worker, count) -- With these in place, we can expand this list of jids based on the work -- queue itself and the priorities therein - table.extend(jids, self.work.peek(count - #jids)) + extend_table(jids, self.work.peek(count - #jids)) local state for index, jid in ipairs(jids) do diff --git a/lib/qless/lua/qless.lua b/lib/qless/lua/qless.lua index dd1f6871..3a7791f4 100644 --- a/lib/qless/lua/qless.lua +++ b/lib/qless/lua/qless.lua @@ -24,9 +24,9 @@ QlessRecurringJob.__index = QlessRecurringJob Qless.config = {} -function table.extend(self, other) +local function extend_table(target, other) for i, v in ipairs(other) do - table.insert(self, v) + table.insert(target, v) end end @@ -1118,7 +1118,7 @@ function QlessQueue:peek(now, count) self:check_scheduled(now, count - #jids) - table.extend(jids, self.work.peek(count - #jids)) + extend_table(jids, self.work.peek(count - #jids)) return jids end @@ -1167,7 +1167,7 @@ function QlessQueue:pop(now, worker, count) self:check_scheduled(now, count - #jids) - table.extend(jids, self.work.peek(count - #jids)) + extend_table(jids, self.work.peek(count - #jids)) local state for index, jid in ipairs(jids) do