summaryrefslogtreecommitdiffstats
path: root/common/storage.h
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2016-05-30 23:15:23 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2016-05-30 23:15:23 +0200
commit8588cd99ee9f3ba92a7167be3752fe511200131b (patch)
tree5ecad52cc4a49ebe31d5d410a1eb396e74ca3f9e /common/storage.h
parentfe1940830d7cc2e9c652ec9a13ca7f3790ff4079 (diff)
downloadsink-8588cd99ee9f3ba92a7167be3752fe511200131b.tar.gz
sink-8588cd99ee9f3ba92a7167be3752fe511200131b.zip
Detect and recover from invalid database environment.
Sometimes wrong databases are returned for the name, probably related to threading/incorrect usage of lmdb. For the time being we recover from that by detecting it and retrying.
Diffstat (limited to 'common/storage.h')
-rw-r--r--common/storage.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/common/storage.h b/common/storage.h
index 87573e2..0527c4f 100644
--- a/common/storage.h
+++ b/common/storage.h
@@ -141,6 +141,7 @@ public:
141 void abort(); 141 void abort();
142 142
143 QList<QByteArray> getDatabaseNames() const; 143 QList<QByteArray> getDatabaseNames() const;
144 bool validateNamedDatabases();
144 145
145 NamedDatabase openDatabase(const QByteArray &name = QByteArray("default"), 146 NamedDatabase openDatabase(const QByteArray &name = QByteArray("default"),
146 const std::function<void(const Storage::Error &error)> &errorHandler = std::function<void(const Storage::Error &error)>(), bool allowDuplicates = false) const; 147 const std::function<void(const Storage::Error &error)> &errorHandler = std::function<void(const Storage::Error &error)>(), bool allowDuplicates = false) const;