From: Andrew Lewis Date: Thu, 1 Oct 2020 17:11:59 +0000 (+0200) Subject: [Minor] Fix cache key X-Git-Tag: 2.7~269^2~1 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=b2d42ef071ad43773d68e9b9da3d3c1f741362a2;p=rspamd.git [Minor] Fix cache key --- 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)