summaryrefslogtreecommitdiffstats
path: root/common/storage
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2016-10-19 16:15:23 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2016-10-21 09:18:50 +0200
commit9a5f0a14714ec9a6a71a003b72e5ed3520dfa125 (patch)
tree78b2b4ac6fff648998b6e42aa0e4e0d8fb8144b7 /common/storage
parent67ec34a8df3a2c3fe5ffbfd74ef06ee8a52ed2bb (diff)
downloadsink-9a5f0a14714ec9a6a71a003b72e5ed3520dfa125.tar.gz
sink-9a5f0a14714ec9a6a71a003b72e5ed3520dfa125.zip
Removed the whole revision cleanup into the entitystore
Diffstat (limited to 'common/storage')
-rw-r--r--common/storage/entitystore.cpp9
-rw-r--r--common/storage/entitystore.h1
2 files changed, 10 insertions, 0 deletions
diff --git a/common/storage/entitystore.cpp b/common/storage/entitystore.cpp
index 30c7a71..a3d9997 100644
--- a/common/storage/entitystore.cpp
+++ b/common/storage/entitystore.cpp
@@ -303,6 +303,15 @@ void EntityStore::cleanupRevision(qint64 revision)
303 DataStore::setCleanedUpRevision(d->transaction, revision); 303 DataStore::setCleanedUpRevision(d->transaction, revision);
304} 304}
305 305
306void EntityStore::cleanupRevisions(qint64 revision)
307{
308 const auto lastCleanRevision = DataStore::cleanedUpRevision(d->transaction);
309 SinkTrace() << "Cleaning up from " << lastCleanRevision + 1 << " to " << revision;
310 for (qint64 rev = lastCleanRevision + 1; rev <= revision; rev++) {
311 cleanupRevision(revision);
312 }
313}
314
306QVector<QByteArray> EntityStore::fullScan(const QByteArray &type) 315QVector<QByteArray> EntityStore::fullScan(const QByteArray &type)
307{ 316{
308 SinkTrace() << "Looking for : " << type; 317 SinkTrace() << "Looking for : " << type;
diff --git a/common/storage/entitystore.h b/common/storage/entitystore.h
index 39f5fc1..0e7572a 100644
--- a/common/storage/entitystore.h
+++ b/common/storage/entitystore.h
@@ -47,6 +47,7 @@ public:
47 bool modify(const QByteArray &type, const ApplicationDomain::ApplicationDomainType &, const QByteArrayList &deletions, bool replayToSource, const PreprocessModification &); 47 bool modify(const QByteArray &type, const ApplicationDomain::ApplicationDomainType &, const QByteArrayList &deletions, bool replayToSource, const PreprocessModification &);
48 bool remove(const QByteArray &type, const QByteArray &uid, bool replayToSource, const PreprocessRemoval &); 48 bool remove(const QByteArray &type, const QByteArray &uid, bool replayToSource, const PreprocessRemoval &);
49 void cleanupRevision(qint64 revision); 49 void cleanupRevision(qint64 revision);
50 void cleanupRevisions(qint64 revision);
50 51
51 void startTransaction(Sink::Storage::DataStore::AccessMode); 52 void startTransaction(Sink::Storage::DataStore::AccessMode);
52 void commitTransaction(); 53 void commitTransaction();