IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 18589 for trunk/ippTasks


Ignore:
Timestamp:
Jul 16, 2008, 3:30:05 PM (18 years ago)
Author:
bills
Message:

split request finish processing into 'load' and 'run' tasks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTasks/pstamp.pro

    r18534 r18589  
    1212    book init pstampRequest
    1313    book init pstampJob
     14    book init pstampFinish
    1415end
    1516
    … …  
    2728        active true
    2829    end
    29     task pstamp.request.finish
     30
     31    task request.finish.load
     32        active true
     33    end
     34    task request.finish.run
    3035        active true
    3136    end
    … …  
    4954        active false
    5055    end
    51     task pstamp.request.finish
     56    task request.finish.load
     57        active false
     58    end
     59    task request.finish.run
    5260        active false
    5361    end
    … …  
    173181end
    174182
    175 task pstamp.request.finish
    176     #periods     -poll $RUNPOLL
    177     #periods     -exec $RUNEXEC
    178     periods     -poll $RUNPOLL
    179     periods     -exec 5
    180     periods     -timeout 30
     183task request.finish.load
     184    host        local
     185
     186    periods     -poll $LOADPOLL
     187    periods     -exec $LOADEXEC
     188    periods     -timeout 300
    181189    npending    1
    182190
    … …  
    184192        if ($DB:n == 0)
    185193            option DEFAULT
    186             command pstamp_finish.pl --limit 10 --verbose
     194            command pstamptool  -completedreq
    187195        else
    188196            option $DB:$pstampFin_DB
    189             command pstamp_finish.pl --dbname $DB:$pstampFin_DB --limit 10 --verbose
     197            command pstamptool  -completedreq -dbname $DB:$pstampFin_DB
    190198            $pstampFin_DB ++
    191199            if ($pstampFin_DB >= $DB:n) set pstampFin_DB = 0
    … …  
    194202
    195203    task.exit $EXIT_SUCCESS
    196         # nothing to do
    197     end
     204        ipptool2book stdout pstampFinish -key req_id -uniq -setword dbname $options:0 -setword pantaskState INIT
     205        if ($VERBOSE > 2)
     206            book listbook pstampFinish
     207        end
     208
     209        process_cleanup pstampFinish
     210    end
     211
     212    task.exit   default
     213        showcommand failure
     214    end
     215
     216    task.exit   timeout
     217        showcommand timeout
     218    end
     219end
     220
     221task request.finish.run
     222    periods     -poll $RUNPOLL
     223    periods     -exec $RUNEXEC
     224    periods     -timeout 30
     225    npending    1
     226
     227    task.exec
     228        book npages pstampFinish -var N
     229        if ($N == 0) break
     230       
     231        book getpage pstampFinish 0 -var pageName -key pantaskState INIT
     232        if ("$pageName" == "NULL") break
     233
     234        book setword pstampFinish $pageName pantaskState RUN
     235        book getword pstampFinish $pageName req_id -var REQ_ID
     236        book getword pstampFinish $pageName dbname -var DBNAME
     237        book getword pstampFinish $pageName reqType -var REQ_TYPE
     238        book getword pstampFinish $pageName name -var REQ_NAME
     239        book getword pstampFinish $pageName outProduct -var PRODUCT
     240
     241        $run = request_finish.pl --req_id $REQ_ID --req_type $REQ_TYPE --req_name $REQ_NAME --product $PRODUCT
     242
     243        add_standard_args run
     244        options $pageName
     245
     246        if ($VERBOSE > 1)
     247            echo command $run
     248        end
     249        command $run
     250    end
     251
    198252    task.exit default
    199         showcommand failure
     253        echo request.finish.run task.exit status: $JOB_STATUS
     254        process_exit pstampFinish $options:0 $JOB_STATUS
    200255    end
    201256
    202257    task.exit timeout
    203258        showcommand timeout
     259        book setword pstampFinish $options:0 pantaskState TIMEOUT.run
    204260    end
    205261end
Note: See TracChangeset for help on using the changeset viewer.