added option min-time-between-resolves-option and tests for it
[pingcheck] / src / dns / dnsmaster.cpp
index f25f09c..7235a1e 100644 (file)
@@ -39,13 +39,22 @@ DnsMasterItem DnsMaster::TheOnlyInstance;
 void DnsMaster::create_master(const IoServiceItem &io_serv,
                             const boost::asio::ip::address &default_name_server,
                             const int resolved_ip_ttl_threshold,
+                            const int min_time_between_resolves,
                             const int max_address_resolution_attempts,
                             const std::string &cache_file)
 {
     GlobalLogger.info() << "DnsMaster: Creating cache";
-    DnsCacheItem cache( new DnsCache(io_serv, cache_file) );
-    create_master(io_serv, default_name_server, resolved_ip_ttl_threshold,
-                  max_address_resolution_attempts, cache);
+    DnsCacheItem cache(
+            new DnsCache(io_serv,
+                         cache_file,
+                         static_cast<uint32_t>(min_time_between_resolves)
+            )
+        );
+    create_master(io_serv,
+                  default_name_server,
+                  resolved_ip_ttl_threshold,
+                  max_address_resolution_attempts,
+                  cache);
 }
 
 void DnsMaster::create_master(const IoServiceItem &io_serv,