IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 20, 2008, 10:28:17 AM (18 years ago)
Author:
bills
Message:

various updates

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTools/src/pstamptool.c

    r16957 r18244  
    336336    char *query ="INSERT INTO pstampRequest"
    337337                 " (state, uri, ds_id, outFileset, resultsFile)"
    338                  " VALUES( 'new', '%s', %s, '%s', 1)";
     338                 " VALUES( 'new', '%s', %s, '%s', 0)";
    339339
    340340    if (!p_psDBRunQuery(config->dbh, query, uri, ds_id, outFileset)) {
     
    567567    }
    568568    if (job_type) {
    569         if (!strcmp(job_type, "get_image")) {
     569        if (!strcmp(job_type, "get_image") || !strcmp(job_type, "detect_query")) {
    570570            stampJob = false;
    571571        } else if (!strcmp(job_type, "stamp")) {
     
    622622    }
    623623
     624    psString stateString = psMetadataLookupStr(&status, config->args, "-state");
     625    if (!status) {
     626        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -state");
     627        return false;
     628    }
     629    if (!stateString) {
     630        stateString = "run";
     631    }
     632    psString result = psMetadataLookupStr(&status, config->args, "-result");
     633    if (!status) {
     634        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -result");
     635        return false;
     636    }
     637    if (!result) {
     638        result = "0";
     639    }
     640
    624641    char *query;
    625642   
    626643    if (stampJob) {
    627644        query ="INSERT INTO pstampJob"
    628                  " (req_id, state, jobType, uri, outputBase, args)"
    629                  " VALUES( %s, 'run', '%s', '%s', '%s', '%s')";
     645                 " (req_id, state, jobType, uri, outputBase, result, args)"
     646                 " VALUES( %s, '%s', '%s', '%s', '%s', %s, '%s')";
    630647    } else {
    631648        query ="INSERT INTO pstampJob"
    632                  " (req_id, state, jobType, uri, outputBase)"
    633                  " VALUES( %s, 'run', '%s', '%s', '%s')";
    634     }
    635 
    636     if (!p_psDBRunQuery(config->dbh, query, req_id, job_type, uri, outputBase, argString)) {
     649                 " (req_id, state, jobType, uri, outputBase, result)"
     650                 " VALUES( %s, '%s', '%s', '%s', '%s', %s)";
     651    }
     652
     653    if (!p_psDBRunQuery(config->dbh, query, req_id, stateString, job_type, uri, outputBase, result, argString)) {
    637654        psError(PS_ERR_UNKNOWN, false, "database error");
    638655        return false;
Note: See TracChangeset for help on using the changeset viewer.