Skip to content

Commit

Permalink
Create ye_olde_redis.cr
Browse files Browse the repository at this point in the history
fixes #132

Require this file in application startup to revert to the old behavior for redis servers pre 6.2.
robacarp committed Dec 14, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 2bf6035 commit b75b6c2
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/ye_olde_redis.cr
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Monkeypatch to revert to the old Redis behavior, for Redis servers pre 6.2 which don't support
# https://redis.io/docs/latest/commands/lmove/
module Mosquito
class RedisBackend < Mosquito::Backend
def dequeue : JobRun?
if id = redis.rpoplpush waiting_q, pending_q
JobRun.retrieve id.to_s
end
end
end
end

0 comments on commit b75b6c2

Please sign in to comment.