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

Method Pause

lib/perfdata/graphitewriter.cpp:108–130  ·  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

106 * Pause is equivalent to Stop, but with HA capabilities to resume at runtime.
107 */
108void GraphiteWriter::Pause()
109{
110 m_HandleCheckResults.disconnect();
111 m_ReconnectTimer->Stop(true);
112
113 try {
114 ReconnectInternal();
115 } catch (const std::exception&) {
116 Log(LogInformation, "GraphiteWriter")
117 << "'" << GetName() << "' paused. Unable to connect, not flushing buffers. Data may be lost on reload.";
118
119 ObjectImpl<GraphiteWriter>::Pause();
120 return;
121 }
122
123 m_WorkQueue.Join();
124 DisconnectInternal();
125
126 Log(LogInformation, "GraphiteWriter")
127 << "'" << GetName() << "' paused.";
128
129 ObjectImpl<GraphiteWriter>::Pause();
130}
131
132/**
133 * Check if method is called inside the WQ thread.

Callers

nothing calls this directly

Calls 3

LogClass · 0.85
StopMethod · 0.45
JoinMethod · 0.45

Tested by

no test coverage detected