diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-07-03 14:02:27 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-07-03 14:02:27 +0200 |
commit | 55fe06979ceebe67553135b43aa47e70d931304b (patch) | |
tree | 16b10a744879cc1872d6c07624b59ae64469ddbf /common/store.cpp | |
parent | 56fae95f49a1ca8ca614bd9f89b0ea5f872765e9 (diff) | |
parent | 288946f1694c2abe1d2c5800c87339d1e8780e4b (diff) | |
download | sink-55fe06979ceebe67553135b43aa47e70d931304b.tar.gz sink-55fe06979ceebe67553135b43aa47e70d931304b.zip |
Merge branch 'develop'
Diffstat (limited to 'common/store.cpp')
-rw-r--r-- | common/store.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/common/store.cpp b/common/store.cpp index d266098..4735113 100644 --- a/common/store.cpp +++ b/common/store.cpp | |||
@@ -36,8 +36,6 @@ | |||
36 | #include "storage.h" | 36 | #include "storage.h" |
37 | #include "log.h" | 37 | #include "log.h" |
38 | 38 | ||
39 | SINK_DEBUG_AREA("store") | ||
40 | |||
41 | Q_DECLARE_METATYPE(QSharedPointer<Sink::ResultEmitter<Sink::ApplicationDomain::SinkResource::Ptr>>) | 39 | Q_DECLARE_METATYPE(QSharedPointer<Sink::ResultEmitter<Sink::ApplicationDomain::SinkResource::Ptr>>) |
42 | Q_DECLARE_METATYPE(QSharedPointer<Sink::ResourceAccessInterface>); | 40 | Q_DECLARE_METATYPE(QSharedPointer<Sink::ResourceAccessInterface>); |
43 | Q_DECLARE_METATYPE(std::shared_ptr<void>); | 41 | Q_DECLARE_METATYPE(std::shared_ptr<void>); |
@@ -277,6 +275,19 @@ KAsync::Job<void> Store::removeDataFromDisk(const QByteArray &identifier) | |||
277 | }); | 275 | }); |
278 | } | 276 | } |
279 | 277 | ||
278 | KAsync::Job<void> Store::upgrade() | ||
279 | { | ||
280 | SinkLog() << "Upgrading..."; | ||
281 | return fetchAll<ApplicationDomain::SinkResource>({}) | ||
282 | .template each([](const ApplicationDomain::SinkResource::Ptr &resource) -> KAsync::Job<void> { | ||
283 | SinkLog() << "Removing caches for " << resource->identifier(); | ||
284 | return removeDataFromDisk(resource->identifier()); | ||
285 | }) | ||
286 | .then([] { | ||
287 | SinkLog() << "Upgrade complete."; | ||
288 | }); | ||
289 | } | ||
290 | |||
280 | static KAsync::Job<void> synchronize(const QByteArray &resource, const Sink::SyncScope &scope) | 291 | static KAsync::Job<void> synchronize(const QByteArray &resource, const Sink::SyncScope &scope) |
281 | { | 292 | { |
282 | SinkLog() << "Synchronizing " << resource << scope; | 293 | SinkLog() << "Synchronizing " << resource << scope; |