lib/pallets/backends/scripts/save.lua in pallets-0.8.0 vs lib/pallets/backends/scripts/save.lua in pallets-0.9.0
- old
+ new
@@ -20,11 +20,11 @@
if #work > 0 then
redis.call("LPUSH", KEYS[2], unpack(work))
redis.call("ZREM", KEYS[1], unpack(work))
end
--- Decrement ETA and remove it together with the context if all tasks have
--- been processed (ETA is 0)
+-- Decrement ETA and remove it together with the context and jobmasks if all
+-- tasks have been processed (ETA is 0) or if workflow has been given up (ETA is -1)
local remaining = redis.call("DECR", KEYS[6])
-if remaining == 0 then
- redis.call("DEL", KEYS[5], KEYS[6])
+if remaining <= 0 then
+ redis.call("DEL", KEYS[5], KEYS[6], KEYS[8])
end