mirror of
https://github.com/mailcow/mailcow-dockerized.git
synced 2026-11-09 10:21:45 +00:00
[Web][Rspamd] Keep the global archive switch in Redis only
This commit is contained in:
15 files changed
+78
-55
No files matched your search
@@ -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);
|
||||
|
||||
@@ -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
|
||||
})
|
||||
Reference in new issue
Block a user