/*
- * $Id: neighbors.cc,v 1.212 1998/05/21 00:46:16 wessels Exp $
+ * $Id: neighbors.cc,v 1.213 1998/05/21 03:22:43 wessels Exp $
*
* DEBUG: section 15 Neighbor Routines
* AUTHOR: Harvest Derived
peerRefreshDNS(void *datanotused)
{
peer *p = NULL;
- peer *next = Config.peers;
- while ((p = next) != NULL) {
- next = p->next;
- /* some random, bogus FD for ipcache */
- p->test_fd = Squid_MaxFD + current_time.tv_usec;
- ipcache_nbgethostbyname(p->host, peerDNSConfigure, p);
+ if (0 == stat5minClientRequests()) {
+ /* no recent client traffic, wait a bit */
+ eventAddIsh("peerRefreshDNS", peerRefreshDNS, NULL, 180.0, 1);
+ return;
}
+ for (p = Config.peers; p; p = p->next)
+ ipcache_nbgethostbyname(p->host, peerDNSConfigure, p);
/* Reconfigure the peers every hour */
eventAddIsh("peerRefreshDNS", peerRefreshDNS, NULL, 3600.0, 1);
}
extern void statInit(void);
extern double median_svc_get(int, int);
extern void pconnHistCount(int, int);
+extern int stat5minClientRequests(void);
+
/* StatHist */
extern void statHistClean(StatHist * H);
/*
- * $Id: stat.cc,v 1.249 1998/05/15 17:16:21 wessels Exp $
+ * $Id: stat.cc,v 1.250 1998/05/21 03:22:46 wessels Exp $
*
* DEBUG: section 18 Cache Manager Statistics
* AUTHOR: Harvest Derived
return &CountHist[minutes];
}
+int
+stat5minClientRequests(void)
+{
+ assert(N_COUNT_HIST > 5);
+ return Counter.client_http.requests - CountHist[5].client_http.requests;
+}
+
#if STAT_GRAPHS
/*