Skip to content

Commit

Permalink
fix: rollback cache scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasoares committed Jun 30, 2023
1 parent 34cd6a8 commit ff62c85
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/components.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
4 changes: 2 additions & 2 deletions internal/queue/cache/redis_cache_scripts.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 ''
Expand Down

0 comments on commit ff62c85

Please sign in to comment.