diff options
author | Dan Goodliffe <randomdan@akira.random.lan> | 2014-11-30 13:34:59 +0000 |
---|---|---|
committer | Dan Goodliffe <randomdan@akira.random.lan> | 2014-11-30 13:34:59 +0000 |
commit | 936aa1622de64528c7eb47c5e6855f0445f9c087 (patch) | |
tree | f699e92af7d5f6b57da004f4d7f68ae4b4dc63d6 | |
parent | Remove the continue on error options for plugables and add proper handling in... (diff) | |
download | project2-936aa1622de64528c7eb47c5e6855f0445f9c087.tar.bz2 project2-936aa1622de64528c7eb47c5e6855f0445f9c087.tar.xz project2-936aa1622de64528c7eb47c5e6855f0445f9c087.zip |
Only attempt to clear caches if the directory exists
-rw-r--r-- | project2/files/presenterCache.cpp | 4 | ||||
-rw-r--r-- | project2/xml/xmlCache.cpp | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/project2/files/presenterCache.cpp b/project2/files/presenterCache.cpp index da63bf3..7c81ff8 100644 --- a/project2/files/presenterCache.cpp +++ b/project2/files/presenterCache.cpp @@ -252,7 +252,9 @@ class FilePresenterCacheLoader : public ElementLoader::For<FilePresenterCache> { void onIdle() override { try { - emptyDir(FilePresenterCache::Store); + if (boost::filesystem::is_directory(FilePresenterCache::Store)) { + emptyDir(FilePresenterCache::Store); + } } catch (...) { Logger()->messagebf(LOG_WARNING, "Failed to purge presenter caches from %s", FilePresenterCache::Store); diff --git a/project2/xml/xmlCache.cpp b/project2/xml/xmlCache.cpp index d6e2e04..649ce02 100644 --- a/project2/xml/xmlCache.cpp +++ b/project2/xml/xmlCache.cpp @@ -90,7 +90,9 @@ class CustomXmlCacheLoader : public ElementLoader::For<XmlCache> { void onIdle() override { try { - emptyDir(XmlCache::Store); + if (boost::filesystem::is_directory(XmlCache::Store)) { + emptyDir(XmlCache::Store); + } } catch (...) { Logger()->messagebf(LOG_WARNING, "Failed to purge caches from %s", XmlCache::Store); |