From 2428fd2ffce7f6bb12c20aefa83efe2295112710 Mon Sep 17 00:00:00 2001 From: Jim Wu Date: Sun, 20 Dec 2020 23:16:40 +0800 Subject: [PATCH] Make the list effective in real time --- .../src/main/cpp/main/src/config_manager.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/edxp-core/src/main/cpp/main/src/config_manager.cpp b/edxp-core/src/main/cpp/main/src/config_manager.cpp index 2dfdd287..8beded8d 100644 --- a/edxp-core/src/main/cpp/main/src/config_manager.cpp +++ b/edxp-core/src/main/cpp/main/src/config_manager.cpp @@ -249,11 +249,16 @@ namespace edxp { return app_modules_list; } - std::filesystem::file_time_type ConfigManager::GetLastWriteTime() const { - auto modules_list = GetConfigPath("modules.list"); - if (!path_exists(modules_list)) - return {}; - return fs::last_write_time(modules_list); + fs::file_time_type ConfigManager::GetLastWriteTime() const { + auto config_path = GetConfigPath(); + auto blacklist_path = GetConfigPath("blacklist"); + auto whitelist_path = GetConfigPath("whitelist"); + return std::max({path_exists(config_path) ? fs::last_write_time(config_path) + : fs::file_time_type{}, + path_exists(blacklist_path) ? fs::last_write_time(blacklist_path) + : fs::file_time_type{}, + path_exists(whitelist_path) ? fs::last_write_time(whitelist_path) + : fs::file_time_type{}}); } bool ConfigManager::InitConfigPath() const {