Remove duplicate check from task diag (#3545)

This commit is contained in:
koleesch 2024-07-07 19:19:54 +02:00 committed by GitHub
parent 6d3519419e
commit 847c482c25
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 1 additions and 79 deletions

View file

@ -300,35 +300,8 @@ int CmdDiagnostics::execute (std::string& output)
<< Context::getContext ().getHeight ()
<< '\n';
// Scan tasks for duplicate UUIDs.
auto all = Context::getContext ().tdb2.all_tasks ();
std::map <std::string, int> seen;
std::vector <std::string> dups;
std::string uuid;
for (auto& i : all)
{
uuid = i.get ("uuid");
if (seen.find (uuid) != seen.end ())
dups.push_back (uuid);
else
seen[uuid] = 0;
}
out << " Dups: "
<< format ("Scanned {1} tasks for duplicate UUIDs:", all.size ())
<< '\n';
if (dups.size ())
{
for (auto& d : dups)
out << " " << format ("Found duplicate {1}", d) << '\n';
}
else
{
out << " No duplicates found\n";
}
// Check all the UUID references
auto all = Context::getContext ().tdb2.all_tasks ();
bool noBrokenRefs = true;
out << " Broken ref: "