summaryrefslogtreecommitdiffstats
path: root/common/storage
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2017-05-12 16:15:34 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2017-05-12 17:18:18 +0200
commit6a3bf46334fc4136da480287898d3f19c88261ee (patch)
treebfdf4a3050974baa0ce5862930de4f9fcdbd13b7 /common/storage
parent076ae4c6bec75b081fec9cdc7a84d82ffcadc94f (diff)
downloadsink-6a3bf46334fc4136da480287898d3f19c88261ee.tar.gz
sink-6a3bf46334fc4136da480287898d3f19c88261ee.zip
Avoid redoing stuff over and over that we can easily avoid.
Diffstat (limited to 'common/storage')
-rw-r--r--common/storage/entitystore.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/common/storage/entitystore.cpp b/common/storage/entitystore.cpp
index d2161a6..6ff700e 100644
--- a/common/storage/entitystore.cpp
+++ b/common/storage/entitystore.cpp
@@ -96,9 +96,13 @@ class EntityStore::Private {
96public: 96public:
97 Private(const ResourceContext &context, const Sink::Log::Context &ctx) : resourceContext(context), logCtx(ctx.subContext("entitystore")) 97 Private(const ResourceContext &context, const Sink::Log::Context &ctx) : resourceContext(context), logCtx(ctx.subContext("entitystore"))
98 { 98 {
99 99 static bool initialized = false;
100 if (!QDir().mkpath(entityBlobStorageDir())) { 100 if (!initialized) {
101 SinkWarningCtx(logCtx) << "Failed to create the directory: " << entityBlobStorageDir(); 101 if (QDir{}.mkpath(entityBlobStorageDir())) {
102 initialized = true;
103 } else {
104 SinkWarningCtx(logCtx) << "Failed to create the directory: " << entityBlobStorageDir();
105 }
102 } 106 }
103 } 107 }
104 108