IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 11, 2009, 4:15:20 PM (17 years ago)
Author:
bills
Message:

support for fake jobs

File:
1 edited

Legend:

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

    r24969 r25054  
    496496{
    497497    bool    stampJob = false;
    498     char   *query = NULL;
    499498
    500499    PS_ASSERT_PTR_NON_NULL(config, false);
     
    503502    PXOPT_LOOKUP_STR(rownum,      config->args, "-rownum",     true, false);
    504503    PXOPT_LOOKUP_STR(job_type,    config->args, "-job_type",   false, false);
    505     PXOPT_LOOKUP_STR(outputBase,  config->args, "-outputBase", true,  false);
     504    PXOPT_LOOKUP_STR(outputBase,  config->args, "-outputBase", false,  false);
    506505    PXOPT_LOOKUP_STR(stateString, config->args, "-state",      false, false);
    507     PXOPT_LOOKUP_STR(fault,       config->args, "-fault",      false, false);
     506    PXOPT_LOOKUP_S16(fault,       config->args, "-fault",      false, false);
    508507    PXOPT_LOOKUP_S64(exp_id,      config->args, "-exp_id",     false, false);
     508
     509    // unless the job is being inserted with stop state require outputBase
     510    if (strcmp(stateString, "stop") && !outputBase) {
     511        psError(PS_ERR_UNKNOWN, true, "-outputBase is required");
     512        return false;
     513    }
    509514
    510515    // default value for job_type is defined in pstamptoolConfig.c
     
    517522        return false;
    518523    }
    519     if (stampJob) {
    520         query = pxDataGet("pstamptool_addjob_stampjob.sql");
    521     } else {
    522         query = pxDataGet("pstamptool_addjob_otherjob.sql");
    523     }
    524     if (!query) {
    525         psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement");
    526         return false;
    527     }
    528 
    529     if (!p_psDBRunQueryF(config->dbh, query, req_id, rownum, stateString, job_type, exp_id, outputBase, fault)) {
     524    if (!pstampJobInsert(config->dbh,
     525            0, // job_id
     526            req_id,
     527            rownum,
     528            stateString,
     529            job_type,
     530            fault,
     531            exp_id,
     532            outputBase
     533            )) {
    530534        psError(PS_ERR_UNKNOWN, false, "database error");
    531535        return false;
Note: See TracChangeset for help on using the changeset viewer.