diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-08-16 10:59:16 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-08-16 11:24:20 +0100 |
commit | 63d7b41dc90d04b82e49d0920c12a2c3bb74dae7 (patch) | |
tree | 51aa0929179bef9f7117acb849578ec7911405c4 /lualib | |
parent | dbc40f735fc9205719bf390f295df5b40d8dcb80 (diff) | |
download | rspamd-63d7b41dc90d04b82e49d0920c12a2c3bb74dae7.tar.gz rspamd-63d7b41dc90d04b82e49d0920c12a2c3bb74dae7.zip |
[Minor] Dmarc_report: Improve dates detection
Diffstat (limited to 'lualib')
-rw-r--r-- | lualib/rspamadm/dmarc_report.lua | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lualib/rspamadm/dmarc_report.lua b/lualib/rspamadm/dmarc_report.lua index acc941400..b6811df98 100644 --- a/lualib/rspamadm/dmarc_report.lua +++ b/lualib/rspamadm/dmarc_report.lua @@ -663,7 +663,12 @@ local function handler(args) lua_util.debugm(N, 'previous last report date is %s', start_time) if not opts.date or #opts.date == 0 then - opts.date = {os.date('!%Y%m%d', os.time())} + local now = os.time() + opts.date = {} + while now >= start_time do + table.insert(opts.date, os.date('!%Y%m%d', now)) + now = now - 86400 + end end local ndates = 0 @@ -691,7 +696,7 @@ local function handler(args) ndates, nreports, nsuccess, nfail) end lua_redis.request(redis_params, redis_attrs, - {'SETEX', 'rspamd_dmarc_last_collection', dmarc_settings.reporting.keys_expire, + {'SETEX', 'rspamd_dmarc_last_collection', dmarc_settings.reporting.keys_expire * 2, tostring(os.time())}) else logger.messagex('Reporting collection has finished %s dates processed, %s reports: %s completed, %s failed', |