IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 24, 2009, 12:06:55 PM (17 years ago)
Author:
bills
Message:

if a request with a duplicate name is submitted invent a request name
and put the results there

File:
1 edited

Legend:

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

    r25368 r25540  
    1616use File::Basename qw(basename);
    1717use Carp;
     18use POSIX qw( strftime );
    1819
    1920my $verbose;
     
    9899my_die("wrong EXTVER $extver found in $request_file_name", $PS_EXIT_PROG_ERROR) if ($extver ne "1");
    99100
     101
    100102# check for duplicate request name
     103my $duplicate_req_name = 0;
    101104if ($req_id and !$no_update) {
    102105    my $command = "$pstamptool -listreq  -name $req_name -not_req_id $req_id";
     
    109112    if ($success) {
    110113        # -listreq succeeded duplicate request name
     114        print STDERR "REQ_NAME $req_name has already been used\n";
    111115        insertFakeJobForRow(undef, 0, $PSTAMP_DUP_REQUEST);
    112         exit 0;
     116        $duplicate_req_name = 1;
     117        my $datestr = strftime "%Y%m%d%H%M%S.$req_id", gmtime;
     118        $req_name = "ERROR.$datestr";
     119        #exit 0;
    113120    }
    114121}
     
    126133        my_die("$command failed", $PS_EXIT_UNKNOWN_ERROR);
    127134    }
     135}
     136if ($duplicate_req_name) {
     137    exit 0;
    128138}
    129139
Note: See TracChangeset for help on using the changeset viewer.