diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-05-12 16:15:34 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-05-12 17:18:18 +0200 |
commit | 6a3bf46334fc4136da480287898d3f19c88261ee (patch) | |
tree | bfdf4a3050974baa0ce5862930de4f9fcdbd13b7 /common/storage | |
parent | 076ae4c6bec75b081fec9cdc7a84d82ffcadc94f (diff) | |
download | sink-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.cpp | 10 |
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 { | |||
96 | public: | 96 | public: |
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 | ||