Skip to content

Commit

Permalink
Convert method table.extend() to a local function because 'table' is …
Browse files Browse the repository at this point in the history
…readonly since Redis 6.2.7

See redis/redis#10651.

Fixes seomoz#89.

Reported-by: Anton Baklanov
  • Loading branch information
tom93 committed Jul 5, 2022
1 parent 485e356 commit ac2034f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions base.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,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

Expand Down
4 changes: 2 additions & 2 deletions queue.lua
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,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
Expand Down Expand Up @@ -322,7 +322,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
Expand Down

0 comments on commit ac2034f

Please sign in to comment.