IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 38586


Ignore:
Timestamp:
Jul 14, 2015, 1:54:16 PM (11 years ago)
Author:
bills
Message:

Add a task to queue cleanup of images that have been updated for postage stamp requests.
It runs twice a day and discovers whether or not there are any unfinished postage stamp
dependents. If not queues all of the chip, warp, and diff runs in gpc1 database with label like ps_ud%
to be cleaned. If there are outstanding dependents it does not queue the updates since we don't
want to cause problems with the postage stamp jobs that are depending on them.
This should be much better than the formerly manual process which got done whenever Bill happened to think of it.

Location:
trunk
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTasks/pstamp.pro

    r36913 r38586  
    1818$pstampCleanup_DB = 0
    1919$pstampStopFaulted_DB = 0
     20$pstampQCleanup_DB = 0
    2021
    2122# give up on dependents with fault_count >= $PSTAMP_MAX_FAULT_COUNT
     
    12121213    end
    12131214end
     1215
     1216task pstamp.queue.update.cleanup
     1217    host        local
     1218    trange      22:00:00 23:59:59 -nmax 2
     1219    periods     -poll $RUNPOLL
     1220    periods     -exec 3600
     1221    periods     -timeout 120
     1222    npending    1
     1223
     1224    task.exec
     1225        stdout NULL
     1226        stderr $LOGSUBDIR/pstamp.queue.update.cleanup.log
     1227
     1228        $DBNAME = $DB:$pstampQCleanup_DB
     1229        $pstampQCleanup_DB++
     1230        if ($pstampQCleanup_DB >= $DB:n) set pstampQCleanup_DB = 0
     1231
     1232        $run = pstamp_queue_update_cleanup.pl  -$PS_DBSERVER --imagedb gpc1 --label ps_ud%
     1233        add_standard_args run
     1234        echo $run
     1235        command $run
     1236    end
     1237
     1238    task.exit $EXIT_SUCCESS
     1239        # echo nothing to do
     1240    end
     1241
     1242    task.exit   default
     1243        showcommand failure
     1244    end
     1245
     1246    task.exit   crash
     1247        showcommand crash
     1248    end
     1249
     1250    task.exit   timeout
     1251        showcommand timeout
     1252    end
     1253end
  • trunk/ippTools/share/pstamptool_pendingdependent.sql

    r37439 r38586  
    1010LEFT JOIN Label ON pstampRequest.label = Label.label
    1111WHERE pstampDependent.state = 'new'
    12     AND pstampDependent.fault = 0
    1312    AND pstampJob.state = 'run'
    1413    AND pstampRequest.state = 'run'
  • trunk/ippTools/src/pstamptool.c

    r38207 r38586  
    14351435    PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false);
    14361436    PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false);
     1437    PXOPT_LOOKUP_BOOL(includeFaulted, config->args, "-includefaulted", false);
    14371438
    14381439    psString query = pxDataGet("pstamptool_pendingdependent.sql");
     
    14421443    }
    14431444
     1445    if (!includeFaulted) {
     1446        psStringAppend(&query, "    AND (pstampDependent.fault = 0)\n");
     1447    }
     1448
    14441449    if (psListLength(where->list)) {
    14451450        psString whereClause = psDBGenerateWhereConditionSQL(where, NULL);
    1446         psStringAppend(&query, " AND %s", whereClause);
     1451        psStringAppend(&query, "\n    AND %s", whereClause);
    14471452        psFree(whereClause);
    14481453    }
    14491454    psFree(where);
    14501455
    1451     psStringAppend(&query, " GROUP BY dep_id ORDER BY priority DESC, MIN(req_id), dep_id");
     1456    psStringAppend(&query, "\nGROUP BY dep_id ORDER BY priority DESC, MIN(req_id), dep_id");
    14521457
    14531458    // treat limit == 0 as "no limit"
  • trunk/ippTools/src/pstamptoolConfig.c

    r38207 r38586  
    253253    psMetadataAddStr(pendingdependentArgs, PS_LIST_TAIL, "-rlabel", 0,   "define label for dependent", NULL);
    254254    psMetadataAddStr(pendingdependentArgs, PS_LIST_TAIL, "-imagedb", 0,  "define imagedb for depenent", NULL);
     255    psMetadataAddBool(pendingdependentArgs, PS_LIST_TAIL, "-includefaulted", 0,   "include faulted dependents in the output", false);
    255256    psMetadataAddU64(pendingdependentArgs, PS_LIST_TAIL, "-limit",  0,    "limit result set to N items", 0);
    256257    psMetadataAddBool(pendingdependentArgs, PS_LIST_TAIL, "-simple", 0,   "use the simple output format", false);
  • trunk/pstamp/scripts/Makefile.am

    r36634 r38586  
    1313        pstamp_queue_cleanup.pl \
    1414        pstamp_queue_requests.pl \
     15        pstamp_queue_update_cleanup.pl \
    1516        pstamp_request_file \
    1617        pstamp_results_file.pl \
Note: See TracChangeset for help on using the changeset viewer.