[prev in list] [next in list] [prev in thread] [next in thread] 

List:       tor-cvs
Subject:    [or-cvs] r14872: Reloading only after a new GeoIP database  (torstatus/trunk)
From:       kasimir () seul ! org
Date:       2008-05-31 16:56:14
Message-ID: 20080531165614.8DF4114195A7 () moria ! seul ! org
[Download RAW message or body]

Author: kasimir
Date: 2008-05-31 12:56:14 -0400 (Sat, 31 May 2008)
New Revision: 14872

Modified:
   torstatus/trunk/tns_update.pl
Log:
Reloading only after a new GeoIP database

Modified: torstatus/trunk/tns_update.pl
===================================================================
--- torstatus/trunk/tns_update.pl	2008-05-31 16:45:49 UTC (rev 14871)
+++ torstatus/trunk/tns_update.pl	2008-05-31 16:56:14 UTC (rev 14872)
@@ -95,7 +95,7 @@
 }
 
 # Geo::IP needs to be loaded - include a built-in cache
-my $gi = Geo::IP->open($config{'GEOIP_Database_Path'} . \
"GeoIP.dat",GEOIP_MEMORY_CACHE | GEOIP_CHECK_CACHE); +my $gi = \
Geo::IP->open($config{'GEOIP_Database_Path'} . "GeoIP.dat",GEOIP_MEMORY_CACHE);  
 # Loop through until killed
 while (1 == 1)
@@ -161,10 +161,13 @@
 			}
 			$gz->gzclose;
 			close ($output);
-			# The update has completed - save
+			# The update has completed - save the new time
 			$query = "UPDATE Status SET geoip=NOW();";
 			$dbresponse = $dbh->prepare($query);
 			$dbresponse->execute();
+			# Reload the GeoIP database
+			undef $gi;
+			$gi = Geo::IP->open($config{'GEOIP_Database_Path'} . \
"GeoIP.dat",GEOIP_MEMORY_CACHE);  }
 	}
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic