aboutsummaryrefslogtreecommitdiff
path: root/src/common/Metric/Metric.cpp
diff options
context:
space:
mode:
authorjackpoz <giacomopoz@gmail.com>2017-12-17 14:35:18 +0100
committerjackpoz <giacomopoz@gmail.com>2017-12-17 14:35:18 +0100
commit45b2bcfaf266cac74806ed71f32b8dc02cd2321e (patch)
treec64be96bd9d2a9731029813c4515806567e60a77 /src/common/Metric/Metric.cpp
parent3bb166dd5c014df9d5e9bea1479773ee406c0088 (diff)
Shared/Metric: Fix crash on shutdown
Fix crash on shutdown with metrics enabled but InfluxDB stopping before worldserver
Diffstat (limited to 'src/common/Metric/Metric.cpp')
-rw-r--r--src/common/Metric/Metric.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/common/Metric/Metric.cpp b/src/common/Metric/Metric.cpp
index e208cdc4aec..8ef90971808 100644
--- a/src/common/Metric/Metric.cpp
+++ b/src/common/Metric/Metric.cpp
@@ -213,16 +213,17 @@ void Metric::ScheduleSend()
}
}
-void Metric::ForceSend()
+void Metric::Unload()
{
// Send what's queued only if io_service is stopped (so only on shutdown)
if (_enabled && _batchTimer->get_io_service().stopped())
{
_enabled = false;
SendBatch();
- _batchTimer->cancel();
- _overallStatusTimer->cancel();
}
+
+ _batchTimer->cancel();
+ _overallStatusTimer->cancel();
}
void Metric::ScheduleOverallStatusLog()