Pause is equivalent to Stop, but with HA capabilities to resume at runtime. */
| 106 | |
| 107 | /* Pause is equivalent to Stop, but with HA capabilities to resume at runtime. */ |
| 108 | void InfluxdbCommonWriter::Pause() |
| 109 | { |
| 110 | m_HandleCheckResults.disconnect(); |
| 111 | |
| 112 | /* Force a flush. */ |
| 113 | Log(LogDebug, GetReflectionType()->GetName()) |
| 114 | << "Processing pending tasks and flushing data buffers."; |
| 115 | |
| 116 | m_FlushTimer->Stop(true); |
| 117 | m_WorkQueue.Enqueue([this]() { FlushWQ(); }, PriorityLow); |
| 118 | |
| 119 | /* Wait for the flush to complete, implicitly waits for all WQ tasks enqueued prior to pausing. */ |
| 120 | m_WorkQueue.Join(); |
| 121 | |
| 122 | Log(LogInformation, GetReflectionType()->GetName()) |
| 123 | << "'" << GetName() << "' paused."; |
| 124 | |
| 125 | ObjectImpl<InfluxdbCommonWriter>::Pause(); |
| 126 | } |
| 127 | |
| 128 | void InfluxdbCommonWriter::AssertOnWorkQueue() |
| 129 | { |