summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <randomdan@akira.random.lan>2014-11-30 13:34:59 +0000
committerDan Goodliffe <randomdan@akira.random.lan>2014-11-30 13:34:59 +0000
commit936aa1622de64528c7eb47c5e6855f0445f9c087 (patch)
treef699e92af7d5f6b57da004f4d7f68ae4b4dc63d6
parentRemove the continue on error options for plugables and add proper handling in... (diff)
downloadproject2-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.cpp4
-rw-r--r--project2/xml/xmlCache.cpp4
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);