UeberBackend::go();
// Setup the zone cache
+ g_zoneCache.setSLog(slog);
g_zoneCache.setRefreshInterval(::arg().asNum("zone-cache-refresh-interval"));
- try {
- UeberBackend B;
- B.updateZoneCache();
- }
- catch (PDNSException& e) {
- SLOG(g_log << Logger::Error << "PDNSException while filling the zone cache: " << e.reason << endl,
- slog->error(Logr::Error, e.reason, "PDNSException while filling the zone cache"));
- exit(1);
- }
- catch (std::exception& e) {
- SLOG(g_log << Logger::Error << "STL Exception while filling the zone cache: " << e.what() << endl,
- slog->error(Logr::Error, e.what(), "STL Exception while filling the zone cache"));
- exit(1);
+ if (g_zoneCache.getRefreshInterval() != 0) {
+ if (!updateZoneCache(slog)) {
+ exit(1); // NOLINT(concurrency-mt-unsafe) we're single threaded at this point
+ }
}
// NOW SAFE TO CREATE THREADS!