MCPcopy Create free account
hub / github.com/Icinga/icinga2 / Pause

Method Pause

lib/perfdata/gelfwriter.cpp:110–134  ·  view source on GitHub ↗

Pause is equivalent to Stop, but with HA capabilities to resume at runtime. */

Source from the content-addressed store, hash-verified

108
109/* Pause is equivalent to Stop, but with HA capabilities to resume at runtime. */
110void GelfWriter::Pause()
111{
112 m_HandleCheckResults.disconnect();
113 m_HandleNotifications.disconnect();
114 m_HandleStateChanges.disconnect();
115
116 m_ReconnectTimer->Stop(true);
117
118 m_WorkQueue.Enqueue([this]() {
119 try {
120 ReconnectInternal();
121 } catch (const std::exception&) {
122 Log(LogInformation, "GelfWriter")
123 << "Unable to connect, not flushing buffers. Data may be lost.";
124 }
125 }, PriorityImmediate);
126
127 m_WorkQueue.Enqueue([this]() { DisconnectInternal(); }, PriorityLow);
128 m_WorkQueue.Join();
129
130 Log(LogInformation, "GelfWriter")
131 << "'" << GetName() << "' paused.";
132
133 ObjectImpl<GelfWriter>::Pause();
134}
135
136void GelfWriter::AssertOnWorkQueue()
137{

Callers

nothing calls this directly

Calls 4

LogClass · 0.85
StopMethod · 0.45
EnqueueMethod · 0.45
JoinMethod · 0.45

Tested by

no test coverage detected