IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 18381


Ignore:
Timestamp:
Jun 30, 2008, 10:03:43 AM (18 years ago)
Author:
bills
Message:

Get database from pantasks variable in the postage stamp tasks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTasks/pstamp.pro

    r16956 r18381  
    11
    2 # $VERBOSE = 3
    3 
     2#$VERBOSE = 3
     3
     4# these variables wil cycle through the known database names
     5
     6$pstampDS_DB = 0
     7$pstampReq_DB = 0
    48$pstampJob_DB = 0
     9$pstampFin_DB = 0
    510
    611macro pstamp.reset
     
    6570
    6671    task.exec
    67         # echo pstamp_queue_requests.pl
    68         command pstamp_queue_requests.pl
     72        if ($DB:n == 0)
     73            option DEFAULT
     74            command pstamp_queue_requests.pl --limit 5
     75        else
     76            option $DB:$pstampDS_DB
     77            command pstamp_queue_requests.pl --limit 5 --dbname $DB:$pstampDS_DB --verbose
     78            $pstampDS_DB ++
     79            if ($pstampDS_DB >= $DB:n) set pstampDS_DB = 0
     80        end
    6981    end
    7082
     
    91103
    92104    task.exec
    93         command pstamptool  -pendingreq
    94     end
    95 
    96     task.exit $EXIT_SUCCESS
    97         ipptool2book stdout pstampRequest -key req_id -uniq -setword pantaskState INIT
    98 
     105        if ($DB:n == 0)
     106            option DEFAULT
     107            command pstamptool  -pendingreq
     108        else
     109            option $DB:$pstampReq_DB
     110            command pstamptool  -pendingreq -dbname $DB:$pstampReq_DB
     111            $pstampReq_DB ++
     112            if ($pstampReq_DB >= $DB:n) set pstampReq_DB = 0
     113        end
     114    end
     115
     116    task.exit $EXIT_SUCCESS
     117        ipptool2book stdout pstampRequest -key req_id -uniq -setword dbname $options:0 -setword pantaskState INIT
    99118        if ($VERBOSE > 2)
    100119            echo starting request
     
    129148        book setword pstampRequest $pageName pantaskState RUN
    130149        book getword pstampRequest $pageName req_id -var REQ_ID
    131 
    132         $run = pstamp_parser_run.pl $REQ_ID
    133 
     150        book getword pstampRequest $pageName dbname -var DBNAME
     151
     152        $run = pstamp_parser_run.pl --req_id $REQ_ID
     153
     154        add_standard_args run
    134155        options $pageName
    135156
     
    142163
    143164    task.exit default
    144         echo pstamp.request.run task.exit status: $JOB_STATUS
     165#        echo pstamp.request.run task.exit status: $JOB_STATUS
    145166        process_exit pstampRequest $options:0 $JOB_STATUS
    146167    end
     
    161182
    162183    task.exec
    163         $run = pstampfinish
    164         command $run
    165     end
    166 
     184        if ($DB:n == 0)
     185            option DEFAULT
     186            command pstampfinish
     187        else
     188            option $DB:$pstampFin_DB
     189            command pstampfinish -dbname $DB:$pstampFin_DB
     190            $pstampFin_DB ++
     191            if ($pstampFin_DB >= $DB:n) set pstampFin_DB = 0
     192        end
     193    end
     194
     195    task.exit $EXIT_SUCCESS
     196        # nothing to do
     197    end
    167198    task.exit default
    168         # nothing to do
     199        showcommand failure
    169200    end
    170201
     
    185216        if ($DB:n == 0)
    186217            option DEFAULT
    187             #echo command pstamptool -pendingjob -limit 10
    188218            command pstamptool -pendingjob -limit 10
    189219        else
     
    191221            command pstamptool -pendingjob -limit 10 -dbname $DB:$pstampJob_DB
    192222            $pstampJob_DB ++
    193             if ($pstampJob_DB >= $DB:n) set regPendingImfile_DB = 0
     223            if ($pstampJob_DB >= $DB:n) set pstampJob_DB = 0
    194224        end
    195225    end
     
    197227    task.exit $EXIT_SUCCESS
    198228        # echo ipptool2book stdout pstampJob -key job_id -setword dbname $options:0 -setword pantaskState INIT
    199         #ipptool2book stdout pstampJob -key job_id -setword dbname $options:0 -setword pantaskState INIT
    200         ipptool2book stdout pstampJob -key job_id -uniq -setword pantaskState INIT
    201 
     229        ipptool2book stdout pstampJob -key job_id -uniq -setword dbname $options:0 -setword pantaskState INIT
     230
     231        book npages pstampJob -var N
    202232        if ($VERBOSE > 2)
    203             # echo book listbook pstampJob":"
    204             echo starting job:
    205233            book listbook pstampJob
    206234        end
    207235
     236        # delete existing entries in the appropriate pantaskStates
    208237        process_cleanup pstampJob
    209238    end
     
    235264        book setword pstampJob $pageName pantaskState RUN
    236265        book getword pstampJob $pageName job_id -var JOB_ID
    237 
    238         book listpage pstampJob $pageName
    239 
    240         $run = pstamp_job_run.pl $JOB_ID
    241 
    242         # ppstamp_run udpates the state of the job now
    243         #$run = pstamptool -processedjob -state stop -status 0 -job_id $JOB_ID
     266        book getword pstampJob $pageName dbname -var DBNAME
     267
     268        if ($VERBOSE > 1)
     269            book listpage pstampJob $pageName
     270        end
     271
     272
     273        $run = pstamp_job_run.pl --job_id $JOB_ID
     274        add_standard_args run
    244275
    245276        options $pageName
Note: See TracChangeset for help on using the changeset viewer.