summaryrefslogtreecommitdiffstats
path: root/sinksh/syntax_modules/sink_inspect.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'sinksh/syntax_modules/sink_inspect.cpp')
-rw-r--r--sinksh/syntax_modules/sink_inspect.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/sinksh/syntax_modules/sink_inspect.cpp b/sinksh/syntax_modules/sink_inspect.cpp
index b271b4f..9cc3b23 100644
--- a/sinksh/syntax_modules/sink_inspect.cpp
+++ b/sinksh/syntax_modules/sink_inspect.cpp
@@ -85,10 +85,9 @@ bool inspect(const QStringList &args, State &state)
85 }, 85 },
86 false); 86 false);
87 87
88 QSet<QByteArray> uids;
88 db.scan("", [&] (const QByteArray &key, const QByteArray &data) { 89 db.scan("", [&] (const QByteArray &key, const QByteArray &data) {
89 if (!hash.remove(Sink::Storage::DataStore::uidFromKey(key))) { 90 uids.insert(Sink::Storage::DataStore::uidFromKey(key));
90 qWarning() << "Failed to find RID for " << key;
91 }
92 return true; 91 return true;
93 }, 92 },
94 [&](const Sink::Storage::DataStore::Error &e) { 93 [&](const Sink::Storage::DataStore::Error &e) {
@@ -96,6 +95,17 @@ bool inspect(const QStringList &args, State &state)
96 }, 95 },
97 false); 96 false);
98 97
98 int missing = 0;
99 for (const auto &uid : uids) {
100 if (!hash.remove(uid)) {
101 missing++;
102 qWarning() << "Failed to find RID for " << uid;
103 }
104 }
105 if (missing) {
106 qWarning() << "Found a total of " << missing << " missing rids";
107 }
108
99 //If we still have items in the hash it means we have rid mappings for entities 109 //If we still have items in the hash it means we have rid mappings for entities
100 //that no longer exist. 110 //that no longer exist.
101 if (!hash.isEmpty()) { 111 if (!hash.isEmpty()) {