fix: Catch inotify exceptions
This commit is contained in:
parent
61e3f6716c
commit
266705e016
@ -177,7 +177,6 @@ namespace modules
|
|||||||
{
|
{
|
||||||
this->enable(false);
|
this->enable(false);
|
||||||
this->cache = "";
|
this->cache = "";
|
||||||
// this->builder = std::make_unique<Builder>(false);
|
|
||||||
this->formatter = std::make_unique<ModuleFormatter>(ConstCastModule(ModuleImpl).name());
|
this->formatter = std::make_unique<ModuleFormatter>(ConstCastModule(ModuleImpl).name());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -392,8 +391,15 @@ namespace modules
|
|||||||
std::lock_guard<concurrency::SpinLock> lck(this->update_lock);
|
std::lock_guard<concurrency::SpinLock> lck(this->update_lock);
|
||||||
std::vector<std::unique_ptr<InotifyWatch>> watches;
|
std::vector<std::unique_ptr<InotifyWatch>> watches;
|
||||||
|
|
||||||
for (auto &&w : this->watch_list)
|
try {
|
||||||
watches.emplace_back(std::make_unique<InotifyWatch>(w.first, w.second));
|
for (auto &&w : this->watch_list)
|
||||||
|
watches.emplace_back(std::make_unique<InotifyWatch>(w.first, w.second));
|
||||||
|
} catch (InotifyException &e) {
|
||||||
|
watches.clear();
|
||||||
|
get_logger()->error(e.what());
|
||||||
|
std::this_thread::sleep_for(100ms);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
while (this->enabled()) {
|
while (this->enabled()) {
|
||||||
ConstCastModule(ModuleImpl).idle();
|
ConstCastModule(ModuleImpl).idle();
|
||||||
|
Loading…
Reference in New Issue
Block a user