Skip to content

Commit

Permalink
[Minor] History_redis: Allow no expire as a valid expire value
Browse files Browse the repository at this point in the history
  • Loading branch information
vstakhov committed May 22, 2022
1 parent da946d9 commit ce6dd7a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/plugins/lua/history_redis.lua
Expand Up @@ -55,7 +55,7 @@ local redis_params

local settings = {
key_prefix = 'rs_history', -- default key name
expire = 0, -- default no expire
expire = nil, -- default no expire
nrows = 200, -- default rows limit
compress = true, -- use zstd compression when storing data in redis
subject_privacy = false, -- subject privacy is off
Expand Down Expand Up @@ -169,7 +169,7 @@ local function history_save(task)
if ret then
conn:add_cmd('LTRIM', {prefix, '0', string.format('%d', settings.nrows-1)})

if settings.expire > 0 then
if settings.expire and settings.expire > 0 then
conn:add_cmd('EXPIRE', {prefix, string.format('%d', settings.expire)})
end
end
Expand Down

0 comments on commit ce6dd7a

Please sign in to comment.