]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
rec: Fix the cache cleaning code being only run once for workers 7731/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 18 Apr 2019 08:23:47 +0000 (10:23 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 18 Apr 2019 08:23:47 +0000 (10:23 +0200)
pdns/pdns_recursor.cc

index a0dda978a0851ca446c24f235d6094d84b471fa3..aa20a8c74adfdb6a9300473dde1526c5f4e4dbeb 100644 (file)
@@ -2673,16 +2673,15 @@ static void houseKeeping(void *)
   }
 
   try {
-    if(s_running)
+    if(s_running) {
       return;
+    }
     s_running=true;
 
     struct timeval now;
     Utility::gettimeofday(&now, 0);
 
     if(now.tv_sec - last_prune > (time_t)(5 + t_id)) {
-      DTime dt;
-      dt.setTimeval(now);
       t_RC->doPrune(g_maxCacheEntries / g_numThreads); // this function is local to a thread, so fine anyhow
       t_packetCache->doPruneTo(g_maxPacketCacheEntries / g_numWorkerThreads);
 
@@ -2740,8 +2739,8 @@ static void houseKeeping(void *)
           g_log<<Logger::Error<<"Unable to update Trust Anchors: "<<pe.reason<<endl;
         }
       }
-      s_running=false;
     }
+    s_running=false;
   }
   catch(PDNSException& ae)
     {