[Web][Rspamd] Keep the global archive switch in Redis only

This commit is contained in:
FreddleSpl0it committed 2026-11-09 01:09:43 +01:00
1 parent 2fc6868b72
commit c48691fca7
15 files changed
+78 -55

No files matched your search

+1 -1
View File
@@ -21,7 +21,7 @@ catch (PDOException $e) {
http_response_code(501);
exit;
}
// Init Redis, only to mirror the switch rspamd reads
// Init Redis, it keeps the global switch; without it nothing is archived
$redis = new Redis();
try {
$redis->connect('redis-mailcow', 6379);
+3 -7
View File
@@ -1072,13 +1072,12 @@ rspamd_config:register_symbol({
end
local function enabled_cb(err, data)
if not err and type(data) == 'string' and data == '0' then
return
if not err and type(data) == 'string' and data == '1' then
archive()
end
archive()
end
local ret = rspamd_redis_make_request(task,
rspamd_redis_make_request(task,
redis_params, -- connect params
'ARCHIVE_ENABLED', -- hash key
false, -- is write
@@ -1086,8 +1085,5 @@ rspamd_config:register_symbol({
'GET', -- command
{'ARCHIVE_ENABLED'} -- arguments
)
if not ret then
archive()
end
end
})