From 874b0d2be32e2edffedd59ab17bf821456757e29 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Sun, 26 Jun 2016 14:40:13 +0200 Subject: Avoid unnecesary warnings --- common/pipeline.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'common/pipeline.cpp') diff --git a/common/pipeline.cpp b/common/pipeline.cpp index e3b9180..976a83f 100644 --- a/common/pipeline.cpp +++ b/common/pipeline.cpp @@ -115,11 +115,13 @@ void Pipeline::startTransaction() //FIXME this is a temporary measure to recover from a failure to open the named databases correctly. //Once the actual problem is fixed it will be enough to simply crash if we open the wrong database (which we check in openDatabase already). //It seems like the validateNamedDatabase calls actually stops the mdb_put failures during sync... - while (!d->transaction.validateNamedDatabases()) { - Warning() << "Opened an invalid transaction!!!!!!"; - d->transaction = std::move(storage().createTransaction(Storage::ReadWrite, [](const Sink::Storage::Error &error) { - Warning() << error.message; - })); + if (d->storage.exists()) { + while (!d->transaction.validateNamedDatabases()) { + Warning() << "Opened an invalid transaction!!!!!!"; + d->transaction = std::move(storage().createTransaction(Storage::ReadWrite, [](const Sink::Storage::Error &error) { + Warning() << error.message; + })); + } } } -- cgit v1.2.3