[LON-CAPA-cvs] cvs: loncom /metadata_database parse_activity_log.pl

albertel lon-capa-cvs@mail.lon-capa.org
Mon, 19 Sep 2005 20:30:40 -0000


albertel		Mon Sep 19 16:30:40 2005 EDT

  Modified files:              
    /loncom/metadata_database	parse_activity_log.pl 
  Log:
  - typo fix
  - calling &clean_up_and_ext() when we don;'t have the lock ends up deleting the file we have a lock on...
  
  
Index: loncom/metadata_database/parse_activity_log.pl
diff -u loncom/metadata_database/parse_activity_log.pl:1.16 loncom/metadata_database/parse_activity_log.pl:1.17
--- loncom/metadata_database/parse_activity_log.pl:1.16	Mon Sep 19 14:31:57 2005
+++ loncom/metadata_database/parse_activity_log.pl	Mon Sep 19 16:30:37 2005
@@ -2,7 +2,7 @@
 #
 # The LearningOnline Network
 #
-# $Id: parse_activity_log.pl,v 1.16 2005/09/19 18:31:57 matthew Exp $
+# $Id: parse_activity_log.pl,v 1.17 2005/09/19 20:30:37 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -131,7 +131,7 @@
     print STDERR "$0: logging to $logfile".$/;
     if (! open(LOGFILE,">$logfile")) {
         warn("Unable to open $logfile for writing.  Run aborted.");
-        &cleanup_and_exit(5);
+        &clean_up_and_exit(5);
     } else {
         $logthis = \&log_to_file;
     }
@@ -180,7 +180,9 @@
     open(LOCKFILE,'>'.$lockfilename);
     if (!flock(LOCKFILE,LOCK_EX|LOCK_NB)) {
         warn("Unable to lock $lockfilename.  Aborting".$/);
-        &clean_up_and_exit(6);
+        # don't call clean_up_and_exit another instance is running and
+        # we don't want to 'cleanup' there files
+        exit 6;
     }
 
     if (! -e $newfilename && -e $sourcefilename) {