mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-28 02:21:59 +00:00
29 lines
599 B
C++
29 lines
599 B
C++
#pragma once
|
|
|
|
#include <Core/BackgroundSchedulePool.h>
|
|
#include <Interpreters/Context_fwd.h>
|
|
|
|
namespace DB
|
|
{
|
|
|
|
/// Add a task to BackgroundProcessingPool that resolves all hosts and updates cache with constant period.
|
|
class DNSCacheUpdater : WithContext
|
|
{
|
|
public:
|
|
DNSCacheUpdater(ContextPtr context, Int32 update_period_seconds_, UInt32 max_consecutive_failures);
|
|
~DNSCacheUpdater();
|
|
void start();
|
|
|
|
private:
|
|
void run();
|
|
|
|
Int32 update_period_seconds;
|
|
UInt32 max_consecutive_failures;
|
|
|
|
BackgroundSchedulePool & pool;
|
|
BackgroundSchedulePoolTaskHolder task_handle;
|
|
};
|
|
|
|
|
|
}
|