mirror of https://github.com/Icinga/icinga2.git
parent
e3dcc8a610
commit
1a23ae94f9
|
@ -81,6 +81,21 @@ void DbConnection::Pause(void)
|
|||
<< "Pausing IDO connection: " << GetName();
|
||||
|
||||
m_CleanUpTimer.reset();
|
||||
|
||||
DbQuery query1;
|
||||
query1.Table = "programstatus";
|
||||
query1.IdColumn = "programstatus_id";
|
||||
query1.Type = DbQueryUpdate;
|
||||
query1.Category = DbCatProgramStatus;
|
||||
query1.WhereCriteria = new Dictionary();
|
||||
query1.WhereCriteria->Set("instance_id", 0); /* DbConnection class fills in real ID */
|
||||
|
||||
query1.Fields = new Dictionary();
|
||||
query1.Fields->Set("instance_id", 0); /* DbConnection class fills in real ID */
|
||||
query1.Fields->Set("program_end_time", DbValue::FromTimestamp(Utility::GetTime()));
|
||||
ExecuteQuery(query1);
|
||||
|
||||
NewTransaction();
|
||||
}
|
||||
|
||||
void DbConnection::InitializeDbTimer(void)
|
||||
|
|
|
@ -78,6 +78,7 @@ protected:
|
|||
|
||||
virtual void CleanUpExecuteQuery(const String& table, const String& time_column, double max_age);
|
||||
virtual void FillIDCache(const DbType::Ptr& type) = 0;
|
||||
virtual void NewTransaction(void) = 0;
|
||||
|
||||
void UpdateAllObjects(void);
|
||||
|
||||
|
|
|
@ -135,10 +135,15 @@ void IdoMysqlConnection::Disconnect(void)
|
|||
|
||||
void IdoMysqlConnection::TxTimerHandler(void)
|
||||
{
|
||||
m_QueryQueue.Enqueue(boost::bind(&IdoMysqlConnection::NewTransaction, this), true);
|
||||
NewTransaction();
|
||||
}
|
||||
|
||||
void IdoMysqlConnection::NewTransaction(void)
|
||||
{
|
||||
m_QueryQueue.Enqueue(boost::bind(&IdoMysqlConnection::InternalNewTransaction, this));
|
||||
}
|
||||
|
||||
void IdoMysqlConnection::InternalNewTransaction(void)
|
||||
{
|
||||
boost::mutex::scoped_lock lock(m_ConnectionMutex);
|
||||
|
||||
|
|
|
@ -55,6 +55,7 @@ protected:
|
|||
virtual void ExecuteQuery(const DbQuery& query);
|
||||
virtual void CleanUpExecuteQuery(const String& table, const String& time_key, double time_value);
|
||||
virtual void FillIDCache(const DbType::Ptr& type);
|
||||
virtual void NewTransaction(void);
|
||||
|
||||
private:
|
||||
DbReference m_InstanceID;
|
||||
|
@ -80,7 +81,6 @@ private:
|
|||
void InternalActivateObject(const DbObject::Ptr& dbobj);
|
||||
|
||||
void Disconnect(void);
|
||||
void NewTransaction(void);
|
||||
void Reconnect(void);
|
||||
|
||||
void AssertOnWorkQueue(void);
|
||||
|
@ -90,6 +90,7 @@ private:
|
|||
|
||||
void InternalExecuteQuery(const DbQuery& query, DbQueryType *typeOverride = NULL);
|
||||
void InternalCleanUpExecuteQuery(const String& table, const String& time_key, double time_value);
|
||||
void InternalNewTransaction(void);
|
||||
|
||||
virtual void ClearConfigTable(const String& table);
|
||||
|
||||
|
|
|
@ -136,10 +136,15 @@ void IdoPgsqlConnection::Disconnect(void)
|
|||
|
||||
void IdoPgsqlConnection::TxTimerHandler(void)
|
||||
{
|
||||
m_QueryQueue.Enqueue(boost::bind(&IdoPgsqlConnection::NewTransaction, this), true);
|
||||
NewTransaction();
|
||||
}
|
||||
|
||||
void IdoPgsqlConnection::NewTransaction(void)
|
||||
{
|
||||
m_QueryQueue.Enqueue(boost::bind(&IdoPgsqlConnection::NewTransaction, this), true);
|
||||
}
|
||||
|
||||
void IdoPgsqlConnection::InternalNewTransaction(void)
|
||||
{
|
||||
boost::mutex::scoped_lock lock(m_ConnectionMutex);
|
||||
|
||||
|
|
|
@ -55,6 +55,7 @@ protected:
|
|||
virtual void ExecuteQuery(const DbQuery& query);
|
||||
virtual void CleanUpExecuteQuery(const String& table, const String& time_key, double time_value);
|
||||
virtual void FillIDCache(const DbType::Ptr& type);
|
||||
virtual void NewTransaction(void);
|
||||
|
||||
private:
|
||||
DbReference m_InstanceID;
|
||||
|
@ -78,7 +79,7 @@ private:
|
|||
void InternalActivateObject(const DbObject::Ptr& dbobj);
|
||||
|
||||
void Disconnect(void);
|
||||
void NewTransaction(void);
|
||||
void InternalNewTransaction(void);
|
||||
void Reconnect(void);
|
||||
|
||||
void AssertOnWorkQueue(void);
|
||||
|
|
Loading…
Reference in New Issue