* Pause is equivalent to Stop, but with HA capabilities to resume at runtime. */
| 106 | * Pause is equivalent to Stop, but with HA capabilities to resume at runtime. |
| 107 | */ |
| 108 | void 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. |