diff --git a/docs/components.md b/docs/components.md index 905ed72..3340659 100644 --- a/docs/components.md +++ b/docs/components.md @@ -18,7 +18,7 @@ The cache is currently the main component of Deckard. It is used to manage messa Deckard currently supports the following Cache engines: - Memory (default) - Redis - - Supported versions: `5.0.14` to `7.0.11` (we always run our integration tests against the `5.0.14` and the latest) + - Supported versions: `5.0.14` to `7.0.11` (we always run our integration tests against the `5.0.14` and the latest version) The memory implementation is mainly used in tests and local development and is not recommended for production use. diff --git a/internal/queue/cache/redis_cache_scripts.go b/internal/queue/cache/redis_cache_scripts.go index 63565c1..bd87634 100644 --- a/internal/queue/cache/redis_cache_scripts.go +++ b/internal/queue/cache/redis_cache_scripts.go @@ -161,7 +161,7 @@ return elements // // ARGV[3] -> the default score if no score is present in the score lock sorted set const unlockElementsScript = ` -local elements = redis.call('ZRANGE', KEYS[1], ARGV[2], '0', 'BYSCORE', 'REV', 'LIMIT', '0', tostring(ARGV[1])) +local elements = redis.call('ZREVRANGEBYSCORE', KEYS[1], ARGV[2], '0', 'LIMIT', '0', tostring(ARGV[1])) if next(elements) == nil then return '' end @@ -205,7 +205,7 @@ local elements if ARGV[3] == '-inf' and ARGV[4] == '+inf' then elements = redis.call('ZRANGE', KEYS[1], '0', tostring(tonumber(ARGV[1]) - 1)) else - elements = redis.call('ZRANGE', KEYS[1], ARGV[3], ARGV[4], 'BYSCORE', 'LIMIT', '0', tostring(ARGV[1])) + elements = redis.call('ZRANGEBYSCORE', KEYS[1], ARGV[3], ARGV[4], 'LIMIT', '0', tostring(ARGV[1])) end if next(elements) == nil then return ''