1 | |
---|---|
2 | #include <Core/BackgroundSchedulePool.h> |
3 | #include <Common/Stopwatch.h> |
4 | |
5 | |
6 | namespace DB |
7 | { |
8 | |
9 | class Context; |
10 | |
11 | /// Add a task to BackgroundProcessingPool that resolves all hosts and updates cache with constant period. |
12 | class DNSCacheUpdater |
13 | { |
14 | public: |
15 | explicit DNSCacheUpdater(Context & context, Int32 update_period_seconds_); |
16 | ~DNSCacheUpdater(); |
17 | void start(); |
18 | |
19 | private: |
20 | void run(); |
21 | |
22 | Context & context; |
23 | Int32 update_period_seconds; |
24 | |
25 | BackgroundSchedulePool & pool; |
26 | BackgroundSchedulePoolTaskHolder task_handle; |
27 | }; |
28 | |
29 | |
30 | } |
31 |