IDO: Make sure to insert program status during reconnect()

This commit is contained in:
Noah Hilverling 2020-09-24 14:18:49 +02:00
parent 9dd197d0af
commit 03af068302
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;