From 22c14fd964638bb4ce75863e495c4b942c63a110 Mon Sep 17 00:00:00 2001 From: Noah Hilverling Date: Wed, 30 Sep 2020 14:35:34 +0200 Subject: [PATCH] IDO: Always insert customvar status on heavy config update --- lib/db_ido/dbobject.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/lib/db_ido/dbobject.cpp b/lib/db_ido/dbobject.cpp index c48739ede..180abe844 100644 --- a/lib/db_ido/dbobject.cpp +++ b/lib/db_ido/dbobject.cpp @@ -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)); } }