IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 4, 2010, 4:10:59 PM (16 years ago)
Author:
watersc1
Message:

Fix typos in pstamptool database queries.
Add pstampDependent.outdir entry to changes.txt.

Final tested code for detectability server.
Works on test cases that involve updates.

r

File:
1 edited

Legend:

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

    r27751 r27859  
    7474my $ppstamp    = can_run('ppstamp') or (warn "Can't find ppstamp" and $missing_tools = 1);
    7575my $pstamp_get_image_job    = can_run('pstamp_get_image_job.pl') or (warn "Can't find pstamp_get_image_job.pl" and $missing_tools = 1);
     76my $dqueryparse = can_run('dqueryparse.pl') or (warn "Can't find dqueryparse.pl" and $missing_tools = 1);
    7677
    7778if ($missing_tools) {
     
    165166    }
    166167} elsif ($jobType eq "detect_query") {
    167     my_die("detect_query jobs not supported yet", $job_id,$PS_EXIT_CONFIG_ERROR);
     168    # detect_query jobs are basically holders to note that we need a file updated before we can continue.
     169    # Load the argument list that dqueryparse should have created the first time it ran, so we know how to
     170    # run it again the same way.
     171    my $argslist = "$outputBase/parse.args";
     172    open ARGSLIST, "<$argslist" or my_die("failed to open argslist file $argslist", $job_id, $PS_EXIT_UNKNOWN_ERROR);
     173    my $argString = <ARGSLIST>;
     174    close ARGSLIST;
     175    chomp $argString;
     176
     177    # XXX: should we do any other sanity checking?
     178    my_die("arglist file $argslist is empty", $job_id, $PS_EXIT_DATA_ERROR) if !$argString;
     179
     180    my $command = "$dqueryparse --job_id $job_id $argString";
     181    $command .= " --dbname $dbname" if $dbname;
     182    $command .= " --dbserver $dbserver" if $dbserver;
     183    $command .= " --verbose" if $verbose;
     184    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     185        run(command => $command, verbose => $verbose);
     186
     187    # Although dqueryparse can potentially force more updates (and more jobs), it should still return success.
     188    if ($success) {
     189        $jobStatus = $PS_EXIT_SUCCESS;
     190    } else {
     191        $jobStatus = $error_code >> 8;
     192        my_die("dqueryparse.pl failed with error code: $jobStatus", $job_id, $jobStatus);
     193    }
    168194} else {
    169195    my_die("unknown jobType $jobType found", $job_id, $PS_EXIT_PROG_ERROR);
Note: See TracChangeset for help on using the changeset viewer.