mirror of
https://github.com/pocoproject/poco.git
synced 2025-05-02 07:31:37 +02:00
Fixes an issue in DirectoryWatcher where it stops listening for events after a batch deletion
This commit is contained in:
parent
92fa1b1884
commit
5be13279cb
@ -108,7 +108,20 @@ protected:
|
|||||||
DirectoryIterator end;
|
DirectoryIterator end;
|
||||||
while (it != end)
|
while (it != end)
|
||||||
{
|
{
|
||||||
entries[it.path().getFileName()] = ItemInfo(*it);
|
// DirectoryWatcher should not stop watching if it fails to get the info
|
||||||
|
// of a file, it should just ignore it.
|
||||||
|
try
|
||||||
|
{
|
||||||
|
entries[it.path().getFileName()] = ItemInfo(*it);
|
||||||
|
}
|
||||||
|
catch(const Poco::FileNotFoundException& fnfe)
|
||||||
|
{
|
||||||
|
// The file is missing, remove it from the entries so it is treated as
|
||||||
|
// deleted.
|
||||||
|
entries.erase(it.path().getFileName());
|
||||||
|
|
||||||
|
poco_unexpected();
|
||||||
|
}
|
||||||
++it;
|
++it;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user