IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 20, 2009, 11:53:20 AM (16 years ago)
Author:
bills
Message:

add hook for reverting faults > 10

File:
1 edited

Legend:

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

    r25793 r26213  
    774774    PXOPT_COPY_S64(config->args, where, "-fault",  "fault", "==");
    775775    PXOPT_COPY_S64(config->args, where, "-req_id_min",  "req_id", ">=");
     776
    776777    PXOPT_LOOKUP_BOOL(all, config->args, "-all", false);
    777778    PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false);
     779    PXOPT_LOOKUP_S16(fault, config->args, "-fault",  false, false);
     780
     781    // By default only revert faults < 10 which are our "ipp exit codes"
     782    // codes larger than that are the pstamp request interface.
     783    // Don't fault those unless -fault waa provided
     784    psString faultClause = "";
     785    if (!fault) {
     786        faultClause = " \nAND (pstampJob.fault < 10)";
     787    }
    778788
    779789    psString query = pxDataGet("pstamptool_revertjob.sql");
     
    790800    psFree(where);
    791801   
    792     if (!p_psDBRunQuery(config->dbh, query)) {
     802    if (!p_psDBRunQueryF(config->dbh, query, faultClause)) {
    793803        psError(PS_ERR_UNKNOWN, false, "database error");
    794804        return false;
Note: See TracChangeset for help on using the changeset viewer.