[or-cvs] r14872: Reloading only after a new GeoIP database (torstatus/trunk)

kasimir at seul.org kasimir at seul.org
Sat May 31 16:56:14 UTC 2008


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);
 		}
 	}
 



More information about the tor-commits mailing list