g_soas[domain] = newInfo;
}
-void updateThread(const string& workdir, const uint16_t& keep, const uint16_t& axfrTimeout) {
+void updateThread(const string& workdir, const uint16_t& keep, const uint16_t& axfrTimeout, const uint16_t& soaRetry) {
std::map<DNSName, time_t> lastCheck;
// Initialize the serials we have
auto& zoneLastCheck = lastCheck[domain];
if ((current_soa != nullptr && now - zoneLastCheck < current_soa->d_st.refresh) || // Only check if we have waited `refresh` seconds
- (current_soa == nullptr && now - zoneLastCheck < 30)) { // Or if we could not get an update at all still, every 30 seconds
+ (current_soa == nullptr && now - zoneLastCheck < soaRetry)) { // Or if we could not get an update at all still, every 30 seconds
continue;
}
config["axfr-timeout"] = 20;
}
+ if (config["failed-soa-retry"]) {
+ try {
+ config["failed-soa-retry"].as<uint16_t>();
+ } catch (const runtime_error &e) {
+ g_log<<Logger::Error<<"Unable to read 'failed-soa-retry' value: "<<e.what()<<endl;
+ }
+ } else {
+ config["failed-soa-retry"] = 30;
+ }
+
if (config["tcp-in-threads"]) {
try {
config["tcp-in-threads"].as<uint16_t>();
std::thread ut(updateThread,
config["work-dir"].as<string>(),
config["keep"].as<uint16_t>(),
- config["axfr-timeout"].as<uint16_t>());
+ config["axfr-timeout"].as<uint16_t>(),
+ config["failed-soa-retry"].as<uint16_t>());
vector<std::thread> tcpHandlers;
tcpHandlers.reserve(config["tcp-in-threads"].as<uint16_t>());