Skip to content

Commit c4e8fca

Browse files
authored
Only try to remove future event when one found
1 parent 6f944d1 commit c4e8fca

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

backend/redis/workflow.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ type futureEvent struct {
2626
// ARGV[1] - current timestamp for zrange
2727
var futureEventsCmd = redis.NewScript(`
2828
local events = redis.call("ZRANGEBYSCORE", KEYS[1], "-inf", ARGV[1])
29-
redis.call("ZREMRANGEBYSCORE", KEYS[1], "-inf", ARGV[1])
29+
if events ~= false and #events ~= 0 then
30+
redis.call("ZREMRANGEBYSCORE", KEYS[1], "-inf", ARGV[1])
31+
end
3032
return events
3133
`)
3234

0 commit comments

Comments
 (0)