Skip to content

Commit

Permalink
IcingaDB: Cache generated object hash
Browse files Browse the repository at this point in the history
  • Loading branch information
yhabteab committed Sep 12, 2022
1 parent 07e60c1 commit 85c77bd
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/icingadb/icingadb-utility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,13 @@ String IcingaDB::FormatCommandLine(const Value& commandLine)

String IcingaDB::GetObjectIdentifier(const ConfigObject::Ptr& object)
{
return HashValue(new Array({m_EnvironmentId, object->GetName()}));
String identifier = object->GetIcingadbIdentifier();
if (identifier.IsEmpty()) {
identifier = HashValue(new Array({m_EnvironmentId, object->GetName()}));
object->SetIcingadbIdentifier(identifier);
}

return identifier;
}

/**
Expand Down

0 comments on commit 85c77bd

Please sign in to comment.