Skip to content

Commit

Permalink
Make the list effective in real time
Browse files Browse the repository at this point in the history
  • Loading branch information
MlgmXyysd authored and sn-o-w committed Jan 14, 2021
1 parent 657b5f1 commit fd5739b
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions edxp-core/src/main/cpp/main/src/config_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<true>(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<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 {
Expand Down

0 comments on commit fd5739b

Please sign in to comment.