IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 28715


Ignore:
Timestamp:
Jul 26, 2010, 12:06:32 PM (16 years ago)
Author:
rhenders
Message:

Checking for Db server error when grabbing labels

Location:
trunk/tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/czartool/CzarDb.pm

    r28704 r28715  
    3434###########################################################################
    3535sub getCurrentLabels {
    36     my ($self, $server) = @_;
     36    my ($self, $server, $labels) = @_;
    3737
    3838    my $query = $self->{_db}->prepare(<<SQL);
     
    4343SQL
    4444
    45     $query->execute;
    46 
    47     return $query->fetchall_arrayref();
     45
     46    if (!$query->execute) {
     47
     48        print "WARNING: getCurrentLabels() failed\n";
     49        return 0;
     50    }
     51
     52    ${$labels} = $query->fetchall_arrayref();
     53
     54    return 1;
    4855}
    4956
  • trunk/tools/roboczar.pl

    r28707 r28715  
    8686    my $reverting = 0;
    8787    my $server = undef;
    88 
    89     my $rows = undef; # TODO just call label
    90         my $row;
     88    my $rows = undef;
     89    my $row = undef;
    9190
    9291    while (1) {
     
    9493        updateServerStatus();
    9594        updateLabels();
    96         $rows = $czarDb->getCurrentLabels("stdscience");
     95        if (!$czarDb->getCurrentLabels("stdscience", \$rows)) {next;}
    9796
    9897        foreach $stage (@stages) {
    99             $totalNew=$totalFaults=$totalFull=0;
    10098
    10199            $server = $pantasks->getServerForThisStage($stage);
     
    105103            print "* Checking labels for $stage stage\n";
    106104
     105            $totalNew=$totalFaults=$totalFull=0;
    107106            foreach $row ( @{$rows} ) {
    108107                my ($label) = @{$row};
Note: See TracChangeset for help on using the changeset viewer.