From 2cc19f9168917f59148d3ddb6e035b6552ba5342 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Wed, 20 Apr 2016 13:50:22 +0100 Subject: [PATCH] [Fix] Fix ratelimit ctime setting --- src/plugins/lua/ratelimit.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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))) -- 2.39.5