From d0a0dfe886952ba924adacaabf85cb96ce5fe032 Mon Sep 17 00:00:00 2001 From: Florent Chiron Date: Fri, 19 Oct 2018 14:54:30 +0200 Subject: Use new config when reconfiguring tickers in ReporterRegistry (#554) --- kamon-core/src/main/scala/kamon/ReporterRegistry.scala | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/kamon-core/src/main/scala/kamon/ReporterRegistry.scala b/kamon-core/src/main/scala/kamon/ReporterRegistry.scala index ee70de4a..06b9761a 100644 --- a/kamon-core/src/main/scala/kamon/ReporterRegistry.scala +++ b/kamon-core/src/main/scala/kamon/ReporterRegistry.scala @@ -195,12 +195,13 @@ object ReporterRegistry { } private[kamon] def reconfigure(config: Config): Unit = synchronized { - val newConfig = readRegistryConfiguration(config) + val oldConfig = registryConfiguration + registryConfiguration = readRegistryConfiguration(config) - if(newConfig.metricTickInterval != registryConfiguration.metricTickInterval && metricReporters.nonEmpty) + if(oldConfig.metricTickInterval != registryConfiguration.metricTickInterval && metricReporters.nonEmpty) reStartMetricTicker() - if(newConfig.traceTickInterval != registryConfiguration.traceTickInterval && spanReporters.nonEmpty) + if(oldConfig.traceTickInterval != registryConfiguration.traceTickInterval && spanReporters.nonEmpty) reStartTraceTicker() // Reconfigure all registered reporters @@ -224,8 +225,6 @@ object ReporterRegistry { } }(entry.executionContext) } - - registryConfiguration = newConfig } -- cgit v1.2.3