Merge pull request #8331 from Icinga/bugfix/program-status-not-inserted-2.13

IDO: Make sure to insert program status
This commit is contained in:
Alexander Aleksandrovič Klimov 2020-10-16 14:02:21 +02:00 committed by GitHub
commit b98c590d9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 7 deletions

View File

@ -152,7 +152,7 @@ void DbConnection::UpdateProgramStatus()
DbQuery query1; DbQuery query1;
query1.Table = "programstatus"; query1.Table = "programstatus";
query1.IdColumn = "programstatus_id"; query1.IdColumn = "programstatus_id";
query1.Type = DbQueryInsert | DbQueryUpdate; query1.Type = DbQueryInsert | DbQueryDelete;
query1.Category = DbCatProgramStatus; query1.Category = DbCatProgramStatus;
query1.Fields = new Dictionary({ query1.Fields = new Dictionary({
@ -179,7 +179,7 @@ void DbConnection::UpdateProgramStatus()
{ "instance_id", 0 } /* DbConnection class fills in real ID */ { "instance_id", 0 } /* DbConnection class fills in real ID */
}); });
query1.Priority = PriorityHigh; query1.Priority = PriorityImmediate;
queries.emplace_back(std::move(query1)); queries.emplace_back(std::move(query1));
DbQuery query2; DbQuery query2;
@ -485,7 +485,7 @@ void DbConnection::UpdateAllObjects()
continue; continue;
for (const ConfigObject::Ptr& object : dtype->GetObjects()) { for (const ConfigObject::Ptr& object : dtype->GetObjects()) {
UpdateObject(object); m_QueryQueue.Enqueue([this, object](){ UpdateObject(object); }, PriorityHigh);
} }
} }
} }

View File

@ -95,6 +95,8 @@ protected:
void IncreasePendingQueries(int count); void IncreasePendingQueries(int count);
void DecreasePendingQueries(int count); void DecreasePendingQueries(int count);
WorkQueue m_QueryQueue{10000000, 1, LogNotice};
private: private:
bool m_IDCacheValid{false}; bool m_IDCacheValid{false};
std::map<std::pair<DbType::Ptr, DbReference>, String> m_ConfigHashes; std::map<std::pair<DbType::Ptr, DbReference>, String> m_ConfigHashes;

View File

@ -55,8 +55,6 @@ protected:
private: private:
DbReference m_InstanceID; DbReference m_InstanceID;
WorkQueue m_QueryQueue{10000000, 1, LogNotice};
Library m_Library; Library m_Library;
std::unique_ptr<MysqlInterface, MysqlInterfaceDeleter> m_Mysql; std::unique_ptr<MysqlInterface, MysqlInterfaceDeleter> m_Mysql;

View File

@ -48,8 +48,6 @@ protected:
private: private:
DbReference m_InstanceID; DbReference m_InstanceID;
WorkQueue m_QueryQueue{1000000, 1, LogNotice};
Library m_Library; Library m_Library;
std::unique_ptr<PgsqlInterface, PgsqlInterfaceDeleter> m_Pgsql; std::unique_ptr<PgsqlInterface, PgsqlInterfaceDeleter> m_Pgsql;