Shared/Metric: Stop metrics on shutdown

Properly stop metric information gathering and sending on shutdown.
Issue reported by AddressSanitizer.

(cherry picked from commit e9c475d45f)
This commit is contained in:
jackpoz
2017-12-02 20:24:30 +01:00
committed by funjoker
parent 96406e3408
commit 246871e3d5

View File

@@ -217,7 +217,12 @@ void Metric::ForceSend()
{
// Send what's queued only if IoContext is stopped (so only on shutdown)
if (_enabled && Trinity::Asio::get_io_context(*_batchTimer).stopped())
{
_enabled = false;
SendBatch();
_batchTimer->cancel();
_overallStatusTimer->cancel();
}
}
void Metric::ScheduleOverallStatusLog()