From 9a5f0a14714ec9a6a71a003b72e5ed3520dfa125 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Wed, 19 Oct 2016 16:15:23 +0200 Subject: Removed the whole revision cleanup into the entitystore --- common/storage/entitystore.cpp | 9 +++++++++ common/storage/entitystore.h | 1 + 2 files changed, 10 insertions(+) (limited to 'common/storage') 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) DataStore::setCleanedUpRevision(d->transaction, revision); } +void EntityStore::cleanupRevisions(qint64 revision) +{ + const auto lastCleanRevision = DataStore::cleanedUpRevision(d->transaction); + SinkTrace() << "Cleaning up from " << lastCleanRevision + 1 << " to " << revision; + for (qint64 rev = lastCleanRevision + 1; rev <= revision; rev++) { + cleanupRevision(revision); + } +} + QVector EntityStore::fullScan(const QByteArray &type) { 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: bool modify(const QByteArray &type, const ApplicationDomain::ApplicationDomainType &, const QByteArrayList &deletions, bool replayToSource, const PreprocessModification &); bool remove(const QByteArray &type, const QByteArray &uid, bool replayToSource, const PreprocessRemoval &); void cleanupRevision(qint64 revision); + void cleanupRevisions(qint64 revision); void startTransaction(Sink::Storage::DataStore::AccessMode); void commitTransaction(); -- cgit v1.2.3