[or-cvs] r14710: (ticket 79) Stopping TorStatus updating script from dying on (torstatus/trunk)

kasimir at seul.org kasimir at seul.org
Sun May 25 00:59:32 UTC 2008


Author: kasimir
Date: 2008-05-24 20:59:32 -0400 (Sat, 24 May 2008)
New Revision: 14710

Modified:
   torstatus/trunk/tns_update.pl
Log:
(ticket 79) Stopping TorStatus updating script from dying on failures

Modified: torstatus/trunk/tns_update.pl
===================================================================
--- torstatus/trunk/tns_update.pl	2008-05-24 23:08:15 UTC (rev 14709)
+++ torstatus/trunk/tns_update.pl	2008-05-25 00:59:32 UTC (rev 14710)
@@ -97,6 +97,10 @@
 while (1 == 1)
 {
 
+# Don't die on errors
+eval
+{
+
 # Find the initial time
 my $start_time = time();
 
@@ -758,8 +762,14 @@
 $dbh->disconnect();
 close($torSocket);
 
+};
+if ($@) {
+	print "The TorStatus database was not updated properly.  An error has occured.  I will continue to try to update, however.\n";
+}
+
 # Sleep for the desired time from the configuration file
 sleep($config{'Cache_Expire_Time'});
+
 }
 
 ############ Subroutines #####################################################
@@ -848,4 +858,5 @@
 		"LINE1:rh#FF0000:Read History",
 		"LINE1:wh#FFFF00:Write History"
 	);
+
 }



More information about the tor-commits mailing list