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

IDO: Make sure to insert program status
This commit is contained in:
Noah Hilverling 2020-10-13 09:22:57 +02:00 committed by GitHub
commit f56ebaf44d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 7 deletions

View File

@ -150,7 +150,7 @@ void DbConnection::UpdateProgramStatus()
DbQuery query1;
query1.Table = "programstatus";
query1.IdColumn = "programstatus_id";
query1.Type = DbQueryInsert | DbQueryUpdate;
query1.Type = DbQueryInsert | DbQueryDelete;
query1.Category = DbCatProgramStatus;
query1.Fields = new Dictionary({
@ -177,7 +177,7 @@ void DbConnection::UpdateProgramStatus()
{ "instance_id", 0 } /* DbConnection class fills in real ID */
});
query1.Priority = PriorityHigh;
query1.Priority = PriorityImmediate;
queries.emplace_back(std::move(query1));
DbQuery query2;
@ -484,7 +484,7 @@ void DbConnection::UpdateAllObjects()
continue;
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 DecreasePendingQueries(int count);
WorkQueue m_QueryQueue{10000000, 1, LogNotice};
private:
bool m_IDCacheValid{false};
std::map<std::pair<DbType::Ptr, DbReference>, String> m_ConfigHashes;

View File

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

View File

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