mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-22 05:04:30 +02:00
parent
f862923dc7
commit
00eba25ad7
@ -55,6 +55,8 @@ void RedisWriter::ConfigStaticInitialize(void)
|
|||||||
//TODO: OnActiveChanged handling.
|
//TODO: OnActiveChanged handling.
|
||||||
void RedisWriter::UpdateAllConfigObjects(void)
|
void RedisWriter::UpdateAllConfigObjects(void)
|
||||||
{
|
{
|
||||||
|
AssertOnWorkQueue();
|
||||||
|
|
||||||
//TODO: Just use config types
|
//TODO: Just use config types
|
||||||
for (const Type::Ptr& type : Type::GetAllTypes()) {
|
for (const Type::Ptr& type : Type::GetAllTypes()) {
|
||||||
if (!ConfigObject::TypeInstance->IsAssignableFrom(type))
|
if (!ConfigObject::TypeInstance->IsAssignableFrom(type))
|
||||||
@ -116,6 +118,8 @@ void RedisWriter::UpdateAllConfigObjects(void)
|
|||||||
|
|
||||||
void RedisWriter::SendConfigUpdate(const ConfigObject::Ptr& object, const String& typeName)
|
void RedisWriter::SendConfigUpdate(const ConfigObject::Ptr& object, const String& typeName)
|
||||||
{
|
{
|
||||||
|
AssertOnWorkQueue();
|
||||||
|
|
||||||
/* Serialize config object attributes */
|
/* Serialize config object attributes */
|
||||||
Dictionary::Ptr objectAttrs = SerializeObjectAttrs(object, FAConfig);
|
Dictionary::Ptr objectAttrs = SerializeObjectAttrs(object, FAConfig);
|
||||||
|
|
||||||
@ -147,6 +151,8 @@ void RedisWriter::SendConfigUpdate(const ConfigObject::Ptr& object, const String
|
|||||||
|
|
||||||
void RedisWriter::SendStatusUpdate(const ConfigObject::Ptr& object, const String& typeName)
|
void RedisWriter::SendStatusUpdate(const ConfigObject::Ptr& object, const String& typeName)
|
||||||
{
|
{
|
||||||
|
AssertOnWorkQueue();
|
||||||
|
|
||||||
/* Serialize config object attributes */
|
/* Serialize config object attributes */
|
||||||
Dictionary::Ptr objectAttrs = SerializeObjectAttrs(object, FAState);
|
Dictionary::Ptr objectAttrs = SerializeObjectAttrs(object, FAState);
|
||||||
|
|
||||||
|
@ -62,6 +62,8 @@ void RedisWriter::ReconnectTimerHandler(void)
|
|||||||
|
|
||||||
void RedisWriter::TryToReconnect(void)
|
void RedisWriter::TryToReconnect(void)
|
||||||
{
|
{
|
||||||
|
AssertOnWorkQueue();
|
||||||
|
|
||||||
if (m_Context)
|
if (m_Context)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -121,6 +123,8 @@ void RedisWriter::UpdateSubscriptionsTimerHandler(void)
|
|||||||
|
|
||||||
void RedisWriter::UpdateSubscriptions(void)
|
void RedisWriter::UpdateSubscriptions(void)
|
||||||
{
|
{
|
||||||
|
AssertOnWorkQueue();
|
||||||
|
|
||||||
if (!m_Context)
|
if (!m_Context)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -252,6 +256,8 @@ void RedisWriter::HandleEvents(void)
|
|||||||
|
|
||||||
void RedisWriter::HandleEvent(const Dictionary::Ptr& event)
|
void RedisWriter::HandleEvent(const Dictionary::Ptr& event)
|
||||||
{
|
{
|
||||||
|
AssertOnWorkQueue();
|
||||||
|
|
||||||
if (!m_Context)
|
if (!m_Context)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -295,3 +301,8 @@ void RedisWriter::Stop(bool runtimeRemoved)
|
|||||||
|
|
||||||
ObjectImpl<RedisWriter>::Stop(runtimeRemoved);
|
ObjectImpl<RedisWriter>::Stop(runtimeRemoved);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RedisWriter::AssertOnWorkQueue(void)
|
||||||
|
{
|
||||||
|
ASSERT(m_WorkQueue.IsWorkerThread());
|
||||||
|
}
|
||||||
|
@ -69,6 +69,8 @@ private:
|
|||||||
static void VarsChangedHandler(const ConfigObject::Ptr& object);
|
static void VarsChangedHandler(const ConfigObject::Ptr& object);
|
||||||
static void VersionChangedHandler(const ConfigObject::Ptr& object);
|
static void VersionChangedHandler(const ConfigObject::Ptr& object);
|
||||||
|
|
||||||
|
void AssertOnWorkQueue(void);
|
||||||
|
|
||||||
Timer::Ptr m_ReconnectTimer;
|
Timer::Ptr m_ReconnectTimer;
|
||||||
Timer::Ptr m_SubscriptionTimer;
|
Timer::Ptr m_SubscriptionTimer;
|
||||||
WorkQueue m_WorkQueue;
|
WorkQueue m_WorkQueue;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user