fix shutdown for PeriodicLog

This commit is contained in:
Sema Checherinda 2024-08-22 16:34:14 +02:00
parent 00aa60ca03
commit a9e793532a
2 changed files with 6 additions and 4 deletions

View File

@ -1,6 +1,7 @@
#include <Interpreters/PeriodicLog.h>
#include <Interpreters/ErrorLog.h>
#include <Interpreters/MetricLog.h>
#include "Functions/DateTimeTransforms.h"
namespace DB
{
@ -27,7 +28,7 @@ template <typename LogElement>
void PeriodicLog<LogElement>::shutdown()
{
stopCollect();
this->stopFlushThread();
Base::shutdown();
}
template <typename LogElement>

View File

@ -17,6 +17,7 @@ template <typename LogElement>
class PeriodicLog : public SystemLog<LogElement>
{
using SystemLog<LogElement>::SystemLog;
using Base = SystemLog<LogElement>;
public:
using TimePoint = std::chrono::system_clock::time_point;
@ -24,12 +25,12 @@ public:
/// Launches a background thread to collect metrics with interval
void startCollect(size_t collect_interval_milliseconds_);
/// Stop background thread
void stopCollect();
void shutdown() final;
protected:
/// Stop background thread
void stopCollect();
virtual void stepFunction(TimePoint current_time) = 0;
private: