From: wessels <> Date: Tue, 16 Apr 1996 04:50:00 +0000 (+0000) Subject: -Added background processing for rebuilding store X-Git-Tag: SQUID_3_0_PRE1~6170 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bc528c789c0bdda56297c8efe35d008381173858;p=thirdparty%2Fsquid.git -Added background processing for rebuilding store --- diff --git a/src/Makefile.in b/src/Makefile.in index 9185c2f2f1..f5de7f4a6e 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -1,7 +1,7 @@ # # Makefile for the Harvest Object Cache server # -# $Id: Makefile.in,v 1.17 1996/04/12 00:11:02 wessels Exp $ +# $Id: Makefile.in,v 1.18 1996/04/15 22:50:00 wessels Exp $ # # Uncomment and customize the following to suit your needs: # @@ -50,7 +50,7 @@ CLIENT_LIBS = -L../lib -lutil $(XTRA_LIBS) PROGS = cached UTILS = client dnsserver ftpget CGIPROGS = cachemgr.cgi -OBJS = acl.o cache_cf.o cached_error.o comm.o \ +OBJS = acl.o background.o cache_cf.o cached_error.o comm.o \ connect.o debug.o disk.o dynamic_array.o \ fdstat.o filemap.o ftp.o gopher.o \ hash.o http.o icp.o ipcache.o \ diff --git a/src/main.cc b/src/main.cc index 322753c2e7..1687500978 100644 --- a/src/main.cc +++ b/src/main.cc @@ -1,4 +1,4 @@ -/* $Id: main.cc,v 1.32 1996/04/15 18:01:04 wessels Exp $ */ +/* $Id: main.cc,v 1.33 1996/04/15 22:53:35 wessels Exp $ */ /* DEBUG: Section 1 main: startup and main loop */ @@ -250,6 +250,7 @@ int main(argc, argv) int n; /* # of GC'd objects */ time_t last_maintain = 0; time_t last_announce = 0; + time_t loop_delay; errorInitialize(); @@ -302,12 +303,16 @@ int main(argc, argv) if (getCleanRate() > 0) next_cleaning = time(0L) + getCleanRate(); while (1) { + loop_delay = (time_t) 60; /* maintain cache storage */ if (cached_curtime > last_maintain) { storeMaintainSwapSpace(); last_maintain = cached_curtime; } - switch (comm_select((time_t) 60, next_cleaning)) { + /* do background processing */ + if (doBackgroundProcessing()) + loop_delay = (time_t) 0; + switch (comm_select(loop_delay, next_cleaning)) { case COMM_OK: /* do nothing */ break; diff --git a/src/squid.h b/src/squid.h index 0faf1172df..fda965f61a 100644 --- a/src/squid.h +++ b/src/squid.h @@ -1,5 +1,5 @@ -/* $Id: squid.h,v 1.15 1996/04/11 22:52:30 wessels Exp $ */ +/* $Id: squid.h,v 1.16 1996/04/15 22:54:07 wessels Exp $ */ #include "config.h" #include "autoconf.h" @@ -119,6 +119,7 @@ typedef unsigned long u_num32; #include "send-announce.h" #include "acl.h" #include "util.h" +#include "background.h" extern time_t cached_starttime; /* main.c */ extern time_t next_cleaning; /* main.c */