diff options
author | Andrew Lewis <nerf@judo.za.org> | 2020-10-01 19:11:59 +0200 |
---|---|---|
committer | Andrew Lewis <nerf@judo.za.org> | 2020-10-02 10:16:22 +0200 |
commit | b2d42ef071ad43773d68e9b9da3d3c1f741362a2 (patch) | |
tree | 12298d232a76b157a5207e85aab8d71df1021290 /lualib/lua_util.lua | |
parent | b0f1a5ca3db83bbc3defc7b8fad25d25c9c6cbc8 (diff) | |
download | rspamd-b2d42ef071ad43773d68e9b9da3d3c1f741362a2.tar.gz rspamd-b2d42ef071ad43773d68e9b9da3d3c1f741362a2.zip |
[Minor] Fix cache key
Diffstat (limited to 'lualib/lua_util.lua')
-rw-r--r-- | lualib/lua_util.lua | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lualib/lua_util.lua b/lualib/lua_util.lua index 9fd15fa5a..521424966 100644 --- a/lualib/lua_util.lua +++ b/lualib/lua_util.lua @@ -951,10 +951,16 @@ exports.extract_specific_urls = function(params_or_task, lim, need_emails, filte if params.prefix then cache_key = params.prefix else - cache_key = string.format('sp_urls_%d%s%s%s', params.limit, + local cache_key_suffix + if params.flags then + cache_key_suffix = table.concat(params.flags) .. (params.flags_mode or '') + else + cache_key_suffix = string.format('%s%s%s', tostring(params.need_emails or false), tostring(params.need_images or false), tostring(params.need_content or false)) + end + cache_key = string.format('sp_urls_%d%s', params.limit, cache_key_suffix) end local cached = params.task:cache_get(cache_key) |