Changeset 3 for trunk


Ignore:
Timestamp:
Apr 25, 2012, 9:48:10 PM (12 years ago)
Author:
us3
Message:

Added DONE status, check for other unknown statuses that are added

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/gridctl.php

    r1 r3  
    1919if ( ! mysql_select_db( $gDB, $gLink ) )
    2020{
    21    write_log( "$self: Could not connect to DB $gDB" );
     21   write_log( "$self: Could not select DB $gDB - " . mysql_error() );
    2222   mail_to_admin( "fail", "Internal Error: Could not select DB $gDB" );
    2323   exit();
     
    412412
    413413    case 'COMPLETED'   :
     414    case 'DONE'   :
    414415      $query   = "UPDATE analysis SET status='COMPLETE' WHERE gfacID='$gfacID'";
    415416      $message = "Job status request reports job is COMPLETE";
     
    438439
    439440    default            :
     441      // We shouldn't ever get here
    440442      $query   = "";
    441443      $message = "Job status was not recognized - $job_status";
     444      write_log( "$self - update_job_status: " .
     445                 "Job status was not recognized - $job_status\n" .
     446                 "gfacID = $gfacID\n" );
    442447      break;
    443448
     
    535540   // Parse the result
    536541   $gfac_status = parse_response( $xml );
     542
     543   // This may not seem like the best place to do this, but here we have
     544   // the xml straight from GFAC
     545   $status_types = array('SUBMITTED',
     546                         'SUBMITED',
     547                         'INITIALIZED',
     548                         'PENDING',
     549                         'ACTIVE',
     550                         'COMPLETED',
     551                         'DONE',
     552                         'DATA',
     553                         'CANCELED',
     554                         'CANCELLED',
     555                         'FAILED',
     556                         'UNKNOWN');
     557   if ( ! in_array( $gfac_status, $status_types ) )
     558      mail_to_admin( 'debug', "gfacID: /$gfacID/\n" .
     559                              "XML:    /$xml/\n"    .
     560                              "Status: /$gfac_status/\n" );
    537561
    538562   return $gfac_status;
     
    731755   $headers  = "From: $org_name Admin<$admin_email>"     . "\n";
    732756   $headers .= "Cc: $org_name Admin<$admin_email>"       . "\n";
     757   $headers .= "Bcc: Dan Zollars<dzollars@gmail.com>"    . "\n";     // make sure
    733758
    734759   // Set the reply address
  • trunk/manage-us3-pipe.php

    r1 r3  
    4343   global $user;
    4444   global $passwd;
     45   global $self;
    4546
    4647   $list                   = explode( ": ", $msg );
     
    5657   if ( ! $resource )
    5758   {
    58       write_log( "$self process(): Could not connect to DB" );
     59      write_log( "$self process(): Could not connect to MySQL - " . mysql_error() );
    5960      write_log( "$self process(): original msg - $msg" );
    6061      return;
Note: See TracChangeset for help on using the changeset viewer.