summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2017-03-16 19:01:36 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2017-03-16 19:01:36 +0000
commitdb0b9be22810222912a4cdba785a1d9017df42f8 (patch)
tree9ab820d6dbb01f6a41617bab48e0a22c6528409c /src
parent81addbcb2e86f9f97866bec1b2a16a78dd91ec87 (diff)
downloadrspamd-db0b9be22810222912a4cdba785a1d9017df42f8.tar.gz
rspamd-db0b9be22810222912a4cdba785a1d9017df42f8.zip
[Fix] Fix for lua 5.3
Diffstat (limited to 'src')
-rw-r--r--src/plugins/lua/history_redis.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/plugins/lua/history_redis.lua b/src/plugins/lua/history_redis.lua
index eaa087490..5580a4fab 100644
--- a/src/plugins/lua/history_redis.lua
+++ b/src/plugins/lua/history_redis.lua
@@ -98,7 +98,7 @@ local function history_save(task)
local json = ucl.to_format(data, 1)
if settings.compress then
- json = tostring(rspamd_util.zstd_compress(json))
+ json = rspamd_util.zstd_compress(json)
-- Distinguish between compressed and non-compressed options
prefix = prefix .. '_zst'
end
@@ -113,7 +113,7 @@ local function history_save(task)
)
if ret then
- conn:add_cmd('LTRIM', {prefix, '0', tostring(settings.nrows-1)})
+ conn:add_cmd('LTRIM', {prefix, '0', string.format('%d', settings.nrows-1)})
end
end
@@ -174,7 +174,7 @@ local function handle_history_request(task, conn, from, to, reset)
false, -- is write
redis_lrange_cb, --callback
'LRANGE', -- command
- {prefix, tostring(from), tostring(to)} -- arguments
+ {prefix, string.format('%d', from), string.format('%d', to)} -- arguments
)
end
end