]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Fix cache key
authorAndrew Lewis <nerf@judo.za.org>
Thu, 1 Oct 2020 17:11:59 +0000 (19:11 +0200)
committerAndrew Lewis <nerf@judo.za.org>
Fri, 2 Oct 2020 08:16:22 +0000 (10:16 +0200)
lualib/lua_util.lua

index 9fd15fa5a884e6490452cb284543af0c68109f31..521424966c73ae63285d20be5dbb5de6dd8e7aa6 100644 (file)
@@ -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)