mirror of https://github.com/Icinga/icinga2.git
parent
92c28548d1
commit
0d02b01c02
|
@ -492,3 +492,8 @@ void DbConnection::SetIDCacheValid(bool valid)
|
||||||
{
|
{
|
||||||
m_IDCacheValid = valid;
|
m_IDCacheValid = valid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int DbConnection::GetSessionToken(void)
|
||||||
|
{
|
||||||
|
return Application::GetStartTime();
|
||||||
|
}
|
||||||
|
|
|
@ -100,6 +100,8 @@ protected:
|
||||||
|
|
||||||
static void UpdateProgramStatus(void);
|
static void UpdateProgramStatus(void);
|
||||||
|
|
||||||
|
static int GetSessionToken(void);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool m_IDCacheValid;
|
bool m_IDCacheValid;
|
||||||
std::map<DbObject::Ptr, DbReference> m_ObjectIDs;
|
std::map<DbObject::Ptr, DbReference> m_ObjectIDs;
|
||||||
|
|
|
@ -175,7 +175,6 @@ void IdoMysqlConnection::Reconnect(void)
|
||||||
CONTEXT("Reconnecting to MySQL IDO database '" + GetName() + "'");
|
CONTEXT("Reconnecting to MySQL IDO database '" + GetName() + "'");
|
||||||
|
|
||||||
double startTime = Utility::GetTime();
|
double startTime = Utility::GetTime();
|
||||||
m_SessionToken = static_cast<int>(Utility::GetTime());
|
|
||||||
|
|
||||||
SetShouldConnect(true);
|
SetShouldConnect(true);
|
||||||
|
|
||||||
|
@ -449,7 +448,7 @@ void IdoMysqlConnection::ClearTableBySession(const String& table)
|
||||||
{
|
{
|
||||||
Query("DELETE FROM " + GetTablePrefix() + table + " WHERE instance_id = " +
|
Query("DELETE FROM " + GetTablePrefix() + table + " WHERE instance_id = " +
|
||||||
Convert::ToString(static_cast<long>(m_InstanceID)) + " AND session_token <> " +
|
Convert::ToString(static_cast<long>(m_InstanceID)) + " AND session_token <> " +
|
||||||
Convert::ToString(m_SessionToken));
|
Convert::ToString(GetSessionToken()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void IdoMysqlConnection::ClearConfigTable(const String& table)
|
void IdoMysqlConnection::ClearConfigTable(const String& table)
|
||||||
|
@ -748,7 +747,7 @@ bool IdoMysqlConnection::FieldToEscapedString(const String& key, const Value& va
|
||||||
*result = static_cast<long>(m_InstanceID);
|
*result = static_cast<long>(m_InstanceID);
|
||||||
return true;
|
return true;
|
||||||
} else if (key == "session_token") {
|
} else if (key == "session_token") {
|
||||||
*result = m_SessionToken;
|
*result = GetSessionToken();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -71,7 +71,6 @@ protected:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DbReference m_InstanceID;
|
DbReference m_InstanceID;
|
||||||
int m_SessionToken;
|
|
||||||
|
|
||||||
WorkQueue m_QueryQueue;
|
WorkQueue m_QueryQueue;
|
||||||
|
|
||||||
|
|
|
@ -174,7 +174,6 @@ void IdoPgsqlConnection::Reconnect(void)
|
||||||
CONTEXT("Reconnecting to PostgreSQL IDO database '" + GetName() + "'");
|
CONTEXT("Reconnecting to PostgreSQL IDO database '" + GetName() + "'");
|
||||||
|
|
||||||
double startTime = Utility::GetTime();
|
double startTime = Utility::GetTime();
|
||||||
m_SessionToken = static_cast<int>(Utility::GetTime());
|
|
||||||
|
|
||||||
SetShouldConnect(true);
|
SetShouldConnect(true);
|
||||||
|
|
||||||
|
@ -420,7 +419,7 @@ void IdoPgsqlConnection::ClearTableBySession(const String& table)
|
||||||
{
|
{
|
||||||
Query("DELETE FROM " + GetTablePrefix() + table + " WHERE instance_id = " +
|
Query("DELETE FROM " + GetTablePrefix() + table + " WHERE instance_id = " +
|
||||||
Convert::ToString(static_cast<long>(m_InstanceID)) + " AND session_token <> " +
|
Convert::ToString(static_cast<long>(m_InstanceID)) + " AND session_token <> " +
|
||||||
Convert::ToString(m_SessionToken));
|
Convert::ToString(GetSessionToken()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void IdoPgsqlConnection::ClearConfigTable(const String& table)
|
void IdoPgsqlConnection::ClearConfigTable(const String& table)
|
||||||
|
@ -605,7 +604,7 @@ bool IdoPgsqlConnection::FieldToEscapedString(const String& key, const Value& va
|
||||||
*result = static_cast<long>(m_InstanceID);
|
*result = static_cast<long>(m_InstanceID);
|
||||||
return true;
|
return true;
|
||||||
} else if (key == "session_token") {
|
} else if (key == "session_token") {
|
||||||
*result = m_SessionToken;
|
*result = GetSessionToken();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -63,7 +63,6 @@ protected:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DbReference m_InstanceID;
|
DbReference m_InstanceID;
|
||||||
int m_SessionToken;
|
|
||||||
|
|
||||||
WorkQueue m_QueryQueue;
|
WorkQueue m_QueryQueue;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue