]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Merge pull request #17355 from miodvallat/porcupine_tree
authorMiod Vallat <miod.vallat@powerdns.com>
Sat, 30 May 2026 20:57:49 +0000 (22:57 +0200)
committerGitHub <noreply@github.com>
Sat, 30 May 2026 20:57:49 +0000 (22:57 +0200)
auth: skip zone cache refresh logic if disabled

1  2 
pdns/auth-main.cc

index 19881f48fd0e69b80f06c1982cac4d270ee196e3,925d917b71dcdc40afaf7df39f59b347e72285f7..aa0d18e9367fca98aca243551fa66e48f709b654
@@@ -975,21 -986,11 +995,12 @@@ static void mainthread(
    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!