[Bio] / Sprout / LoadSproutTables.pl Repository:
ViewVC logotype

Diff of /Sprout/LoadSproutTables.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.31, Sun Jun 25 07:34:46 2006 UTC revision 1.32, Sat Jul 1 03:17:24 2006 UTC
# Line 328  Line 328 
328    
329  Trace SQL statements.  Trace SQL statements.
330    
331    =item phone
332    
333    Phone number to message when the load finishes.
334    
335  =back  =back
336    
337  =cut  =cut
# Line 354  Line 358 
358                                                loadOnly => [0, "load the database from previously generated files"],                                                loadOnly => [0, "load the database from previously generated files"],
359                                                primaryOnly => [0, "only process the group's main entity"],                                                primaryOnly => [0, "only process the group's main entity"],
360                                                resume => [0, "resume a complete load starting with the first group specified in the parameter list"],                                                resume => [0, "resume a complete load starting with the first group specified in the parameter list"],
361                                                  phone => ["", "phone number (international format) to call when load finishes"],
362                                              },                                              },
363                                              "<group1> <group2> ...",                                              "<group1> <group2> ...",
364                                              @ARGV);                                              @ARGV);
# Line 380  Line 385 
385  } elsif (! @parameters) {  } elsif (! @parameters) {
386      Confess("No load groups were specified.");      Confess("No load groups were specified.");
387  }  }
388    # Set a variable to contain return type information.
389    my $rtype;
390    # Insure we catch errors.
391    eval {
392  # Process the parameters.  # Process the parameters.
393  for my $group (@parameters) {  for my $group (@parameters) {
394      Trace("Processing load group $group.") if T(2);      Trace("Processing load group $group.") if T(2);
# Line 433  Line 442 
442          $group = ResumeCheck($resume, $group);          $group = ResumeCheck($resume, $group);
443      }      }
444  }  }
445    };
446    if ($@) {
447        Trace("Load failed with error: $@") if T(0);
448        $rtype = "error";
449    } else {
450  Trace("Load complete.") if T(2);  Trace("Load complete.") if T(2);
451        $rtype = "no error";
452    }
453    if ($phone) {
454        my $msgID = Tracer::SendSMS($options->{phone}, "Sprout load terminated with $rtype.");
455        if ($msgID) {
456            Trace("Phone message sent with ID $msgID.") if T(2);
457        } else {
458            Trace("Phone message not sent.") if T(2);
459        }
460    }
461  # If the resume flag is set, return "*", else return "".  # If the resume flag is set, return "*", else return "".
462  sub ResumeCheck {  sub ResumeCheck {
463      my ($resume, $group) = @_;      my ($resume, $group) = @_;

Legend:
Removed from v.1.31  
changed lines
  Added in v.1.32

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3