]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Satisfy luacheck
authorAndrew Lewis <nerf@judo.za.org>
Mon, 3 Mar 2025 12:28:09 +0000 (14:28 +0200)
committerAndrew Lewis <nerf@judo.za.org>
Mon, 24 Mar 2025 11:54:51 +0000 (13:54 +0200)
src/plugins/lua/contextal.lua

index 87d3002b06d14fd8637a9f6541ad658615f5ecfe..66fe95405930bc455c2a9a902984a50f4e9e45b7 100644 (file)
@@ -153,17 +153,22 @@ local function submit(task)
   })
 end
 
+local function cache_hit(task, err, data)
+  if err then
+    rspamd_logger.err(task, 'error getting cache: %s', err)
+  else
+    process_cached(task, data)
+  end
+end
+
 local function submit_cb(task)
-  if redis_params then
-    redis_cache.cache_get(task, task:get_digest(), cache_context, settings.cache_timeout,
+  if cache_context then
+    redis_cache.cache_get(task,
+        task:get_digest(),
+        cache_context,
+        settings.cache_timeout,
         submit,
-        function(task, err, data)
-          if err then
-            rspamd_logger.err(task, 'error getting cache: %s', err)
-          else
-            process_cached(task, data)
-          end
-        end
+        cache_hit
     )
   else
     submit(task)