From: Vsevolod Stakhov Date: Wed, 20 Apr 2016 12:50:22 +0000 (+0100) Subject: [Fix] Fix ratelimit ctime setting X-Git-Tag: 1.2.4~1 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=2cc19f9168917f59148d3ddb6e035b6552ba5342;p=rspamd.git [Fix] Fix ratelimit ctime setting --- diff --git a/src/plugins/lua/ratelimit.lua b/src/plugins/lua/ratelimit.lua index 4bca76f93..a6328eb4d 100644 --- a/src/plugins/lua/ratelimit.lua +++ b/src/plugins/lua/ratelimit.lua @@ -94,6 +94,10 @@ local function parse_limits(data) ctime = tonumber(elts[3]) end + if not ctime then + ctime = atime + end + return {atime,bucket,ctime} end end @@ -222,7 +226,7 @@ local function set_limits(task, args) end end - local lstr = string.format('%.3f:%.3f:.3f', ntime, bucket, ctime) + local lstr = string.format('%.3f:%.3f:%.3f', ntime, bucket, ctime) table.insert(values, limit[2]) table.insert(values, lstr) end, _.zip(parse_limits(data), _.iter(args)))