IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 16358 for trunk/pstamp/scripts


Ignore:
Timestamp:
Feb 7, 2008, 2:48:11 PM (18 years ago)
Author:
bills
Message:

Allow test web page to issue request and then query for status.
Added and/or modified scripts to allow jobs to be processed by a pantasks task

Location:
trunk/pstamp/scripts
Files:
3 added
2 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/pstamp/scripts/ppstamp_run.pl

    r16283 r16358  
    1515my $job_id = $ARGV[0];
    1616
    17 my $verbosity = 1;
     17my $verbosity = 0;
    1818
    1919use Sys::Hostname;
     
    125125
    126126
    127 exit $jobStatus;
     127if ($jobStatus eq "ok") {
     128    exit 0;
     129} else {
     130    exit $jobStatus;
     131}
  • trunk/pstamp/scripts/pstamp_dorequest.pl

    r16283 r16358  
    11#!/bin/env perl
    22###
    3 ### pstampdo_req.pl
     3### pstamp_dorequest.pl
    44###
    5 ###     Run the jobs for a given request
    6 ###     This is intended for running outside pantasks environment
     5###     Excecute the jobs for a given request.
     6###     Note: This is intended for testing outside of pantasks environment
    77###
    88
     
    1616my $request_id = $ARGV[0];
    1717
    18 my $verbosity = 1;
     18my $verbosity = 0;
    1919
    2020use Sys::Hostname;
     
    7777    foreach my $job (@$jobs) {
    7878        if ($job->{req_id} == $request_id) {
    79             # there must be a better way to do this
    80             print STDERR "adding $job->{job_id} to the list\n";
     79            # print STDERR "adding $job->{job_id} to the list\n";
    8180            $psjobs[@psjobs] = $job;
    8281        }
     
    8584
    8685if (! @psjobs) {
     86    # TODO: is this always an error, what if the job is no longer pending?
    8787    print STDERR "no pending postage stamp jobs for request $request_id found\n";
    88     # TODO: is this always an error, what if the job is no longer pending?
    8988    exit 1;
    9089}
     
    103102# Update the state of the request
    104103#
     104{
     105    ## TODO: what about request status
     106    my $command = "$pstamptool -processedreq -req_id $request_id -state stop";
     107    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     108        run(command => $command, verbose => $verbosity);
     109    unless ($success) {
     110        die("Unable to perform pstamptool -processedreq: $error_code");
     111    }
     112}
    105113
    106114exit 0;
Note: See TracChangeset for help on using the changeset viewer.