Merge pull request #8326 from Icinga/bugfix/do-not-update-customvar-status-on-heavy-config-update

Do not upsert customvar status on heavy config update
This commit is contained in:
Alexander Aleksandrovič Klimov 2020-10-14 11:00:29 +02:00 committed by GitHub
commit 28f1f70321
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 1 deletions

View File

@ -111,7 +111,6 @@ void DbObject::SendConfigUpdateHeavy(const Dictionary::Ptr& configFields)
{
/* update custom var config and status */
SendVarsConfigUpdateHeavy();
SendVarsStatusUpdate();
/* config attributes */
if (!configFields)
@ -245,6 +244,22 @@ void DbObject::SendVarsConfigUpdateHeavy()
{ "instance_id", 0 } /* DbConnection class fills in real ID */
});
queries.emplace_back(std::move(query3));
DbQuery query4;
query4.Table = "customvariablestatus";
query4.Type = DbQueryInsert;
query4.Category = DbCatState;
query4.Fields = new Dictionary({
{ "varname", kv.first },
{ "varvalue", value },
{ "is_json", is_json },
{ "status_update_time", DbValue::FromTimestamp(Utility::GetTime()) },
{ "object_id", obj },
{ "instance_id", 0 } /* DbConnection class fills in real ID */
});
queries.emplace_back(std::move(query4));
}
}