IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 27, 2009, 11:34:24 AM (17 years ago)
Author:
eugene
Message:

merge changes from trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/20090715/ippTasks/pstamp.pro

    r25402 r25625  
    1 
    2 #$VERBOSE = 3
     1# pstamp.pro : Postage Stamp Server tasks
     2
     3check.globals
     4
     5$LOGSUBDIR = $LOGDIR/pstamp
     6mkdir $LOGSUBDIR
    37
    48# these variables wil cycle through the known database names
     
    812$pstampJob_DB = 0
    913$pstampFin_DB = 0
     14$pstampRev_DB = 0
    1015
    1116# set PS_DBSERVER if postage stamp database host is not the same as the value for DBSERVER in site.config
     
    5257        active true
    5358    end
    54 end
     59    task pstamp.job.revert
     60        active true
     61    end
     62end
     63
    5564
    5665macro pstamp.off
     
    7584    end
    7685    task pstamp.job.run
     86        active false
     87    end
     88    task pstamp.job.revert
     89        active false
     90    end
     91end
     92
     93macro pstamp.revert.on
     94    task pstamp.job.revert
     95        active true
     96    end
     97end
     98macro pstamp.revert.off
     99    task pstamp.job.revert
    77100        active false
    78101    end
     
    88111
    89112    task.exec
     113        stdout $LOGSUBDIR/pstamp.request.find.log
     114        stderr $LOGSUBDIR/pstamp.request.find.log
    90115        if ($DB:n == 0)
    91116            option DEFAULT
     
    125150
    126151    task.exec
     152        stdout $LOGSUBDIR/pstamp.request.load.log
     153        stderr $LOGSUBDIR/pstamp.request.load.log
    127154        $run = pstamptool -pendingreq
    128155        if ($DB:n == 0)
     
    168195
    169196    task.exec
     197        stdout $LOGSUBDIR/pstamp.request.run.log
     198        stderr $LOGSUBDIR/pstamp.request.run.log
    170199        book npages pstampRequest -var N
    171200        if ($N == 0) break
     
    223252
    224253    task.exec
     254        stdout $LOGSUBDIR/pstamp.finish.load.log
     255        stderr $LOGSUBDIR/pstamp.finish.load.log
    225256        $run = pstamptool  -completedreq
    226257        if ($DB:n == 0)
     
    265296
    266297    task.exec
     298        stdout $LOGSUBDIR/request.finish.run.log
     299        stderr $LOGSUBDIR/request.finish.run.log
    267300        book npages pstampFinish -var N
    268301        if ($N == 0) break
     
    320353
    321354    task.exec
     355        stdout $LOGSUBDIR/pstamp.job.load.log
     356        stderr $LOGSUBDIR/pstamp.job.load.log
    322357        $run = pstamptool -pendingjob
    323358        if ($DB:n == 0)
     
    346381    end
    347382
     383    task.exit   crash
     384        showcommand crash
     385    end
     386
     387    task.exit   timeout
     388        showcommand timeout
     389    end
     390
    348391    task.exit   default
    349392        showcommand failure
    350393    end
    351394
    352     task.exit   crash
    353         showcommand crash
    354     end
    355 
    356     task.exit   timeout
    357         showcommand timeout
    358     end
    359395end
    360396
     
    365401
    366402    task.exec
     403        stdout $LOGSUBDIR/pstamp.job.run.log
     404        stderr $LOGSUBDIR/pstamp.job.run.log
    367405        book npages pstampJob -var N
    368406        if ($N == 0)
     
    430468    end
    431469end
     470
     471task pstamp.job.revert
     472    host        local
     473
     474    periods     -poll $LOADPOLL
     475    periods     -exec 10
     476    periods     -timeout 300
     477    npending    1
     478
     479    task.exec
     480        stdout $LOGSUBDIR/pstamp.job.revert.log
     481        stderr $LOGSUBDIR/pstamp.job.revert.log
     482        $run = pstamptool -revertjob -all
     483        if ($DB:n == 0)
     484            option DEFAULT
     485        else
     486            $run = $run $PS_DBSERVER -dbname $DB:$pstampRev_DB
     487            $pstampRev_DB ++
     488            if ($pstampRev_DB >= $DB:n) set pstampRev_DB = 0
     489        end
     490        add_poll_args run
     491        # add_poll_labels run
     492        command $run
     493    end
     494
     495    task.exit $EXIT_SUCCESS
     496        # nothing to do
     497    end
     498
     499    task.exit   default
     500        showcommand failure
     501    end
     502
     503    task.exit   crash
     504        showcommand crash
     505    end
     506
     507    task.exit   timeout
     508        showcommand timeout
     509    end
     510end
     511
Note: See TracChangeset for help on using the changeset viewer.