Make the list effective in real time

This commit is contained in:
Jim Wu 2020-12-20 23:16:40 +08:00
parent 2c90990625
commit 2428fd2ffc
1 changed files with 10 additions and 5 deletions

View File

@ -249,11 +249,16 @@ namespace edxp {
return app_modules_list; return app_modules_list;
} }
std::filesystem::file_time_type ConfigManager::GetLastWriteTime() const { fs::file_time_type ConfigManager::GetLastWriteTime() const {
auto modules_list = GetConfigPath("modules.list"); auto config_path = GetConfigPath();
if (!path_exists<true>(modules_list)) auto blacklist_path = GetConfigPath("blacklist");
return {}; auto whitelist_path = GetConfigPath("whitelist");
return fs::last_write_time(modules_list); return std::max({path_exists<true>(config_path) ? fs::last_write_time(config_path)
: fs::file_time_type{},
path_exists<true>(blacklist_path) ? fs::last_write_time(blacklist_path)
: fs::file_time_type{},
path_exists<true>(whitelist_path) ? fs::last_write_time(whitelist_path)
: fs::file_time_type{}});
} }
bool ConfigManager::InitConfigPath() const { bool ConfigManager::InitConfigPath() const {