Skip to content

Commit b87cd7d

Browse files
LeonidVasTotktonada
authored andcommitted
fix tube_release_all_tasks function
* Added return in case of tarantool version < 1.7.5 * Instead of nil, an empty table is used as "opts" argument of the driver "release" method. This is the policy of the module "queue": "Check opts in abstract.lua, instead to check inside the driver". Fixes #121
1 parent c7d6234 commit b87cd7d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

queue/abstract.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,13 @@ local function tube_release_all_tasks(tube)
7272
log.error(prefix .. 'no stable iterator support: skip task releasing')
7373
log.error(prefix .. 'some tasks may stuck in taken state perpetually')
7474
log.error(prefix .. 'update tarantool to >= 1.7.5 or take the risk')
75+
return
7576
end
7677

7778
log.info(prefix .. 'releasing all taken task (may take a while)')
7879
local released = 0
7980
for _, task in tube.raw:tasks_by_state(state.TAKEN) do
80-
tube.raw:release(task[1])
81+
tube.raw:release(task[1], {})
8182
released = released + 1
8283
end
8384
log.info(prefix .. ('released %d tasks'):format(released))

0 commit comments

Comments
 (0)