From: Vsevolod Stakhov Date: Thu, 1 Dec 2022 22:03:30 +0000 (+0000) Subject: [Minor] Allow to skip hyperscan cleanup if RSPAMD_NO_CLEANUP env variable is set X-Git-Tag: 3.5~176 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=be888170b27f4fdde9c02a11372baf9771b88845;p=rspamd.git [Minor] Allow to skip hyperscan cleanup if RSPAMD_NO_CLEANUP env variable is set --- diff --git a/src/libserver/hyperscan_tools.cxx b/src/libserver/hyperscan_tools.cxx index b6c16e562..49b695cd2 100644 --- a/src/libserver/hyperscan_tools.cxx +++ b/src/libserver/hyperscan_tools.cxx @@ -30,6 +30,7 @@ #include /* for glob */ #include /* for unlink */ #include +#include /* for std::getenv */ #include "unix-std.h" #include "rspamd_control.h" @@ -184,7 +185,7 @@ public: auto cleanup_maybe() -> void { /* We clean dir merely if we are running from the main process */ - if (rspamd_current_worker == nullptr) { + if (rspamd_current_worker == nullptr && std::getenv("RSPAMD_NO_CLEANUP") == nullptr) { const auto *log_func = RSPAMD_LOG_FUNC; auto cleanup_dir = [&](std::string_view dir) -> void { for (const auto &ext : cache_extensions) {