From: Andrew Lewis Date: Mon, 3 Mar 2025 12:28:09 +0000 (+0200) Subject: [Minor] Satisfy luacheck X-Git-Tag: 3.12.0~54^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=30bd97f87852467afa89f729766d47df0a33b7a9;p=thirdparty%2Frspamd.git [Minor] Satisfy luacheck --- diff --git a/src/plugins/lua/contextal.lua b/src/plugins/lua/contextal.lua index 87d3002b06..66fe954059 100644 --- a/src/plugins/lua/contextal.lua +++ b/src/plugins/lua/contextal.lua @@ -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)