diff --git a/include/modules/base.hpp b/include/modules/base.hpp index 069d137e..6b35f65e 100644 --- a/include/modules/base.hpp +++ b/include/modules/base.hpp @@ -177,7 +177,6 @@ namespace modules { this->enable(false); this->cache = ""; - // this->builder = std::make_unique(false); this->formatter = std::make_unique(ConstCastModule(ModuleImpl).name()); } @@ -392,8 +391,15 @@ namespace modules std::lock_guard lck(this->update_lock); std::vector> watches; - for (auto &&w : this->watch_list) - watches.emplace_back(std::make_unique(w.first, w.second)); + try { + for (auto &&w : this->watch_list) + watches.emplace_back(std::make_unique(w.first, w.second)); + } catch (InotifyException &e) { + watches.clear(); + get_logger()->error(e.what()); + std::this_thread::sleep_for(100ms); + return; + } while (this->enabled()) { ConstCastModule(ModuleImpl).idle();