Changeset 25822 for trunk/ippTasks
- Timestamp:
- Oct 9, 2009, 2:02:24 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/ippTasks/destreak.pro (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTasks/destreak.pro
r25708 r25822 10 10 book init magicToDS 11 11 book init magicDSToRevert 12 book init magicDSToCleanup 12 13 13 14 ### indexes into Database lists … … 16 17 $magicDSToRevert_DB = 0 17 18 $magicDSCompletedRevert_DB = 0 19 $magicDSToCleanup_DB = 0 18 20 19 21 #list of stages … … 32 34 book listbook magicToDS 33 35 book listbook magicDSToRevert 36 book init magicDSToCleanup 34 37 end 35 38 … … 38 41 book init magicToDS 39 42 book init magicDSToRevert 43 book init magicDSToCleanup 40 44 end 41 45 … … 71 75 end 72 76 77 macro destreak.cleanup.on 78 task destreak.cleanup.load 79 active true 80 end 81 task destreak.cleanup.run 82 active true 83 end 84 end 85 73 86 ### Turn tasks off 74 87 macro destreak.off … … 92 105 end 93 106 task destreak.completed.revert 107 active false 108 end 109 end 110 macro destreak.cleanup.off 111 task destreak.cleanup.load 112 active false 113 end 114 task destreak.cleanup.run 94 115 active false 95 116 end … … 489 510 end 490 511 512 task destreak.cleanup.load 513 host local 514 515 periods -poll $LOADPOLL 516 periods -exec $LOADEXEC 517 periods -timeout 20 518 npending 1 519 active false 520 521 stdout NULL 522 stderr $LOGSUBDIR/destreak.cleanup.load.log 523 524 task.exec 525 $run = magicdstool -tocleanup 526 if ($DB:n == 0) 527 option DEFAULT 528 else 529 530 # save the DB name for the exit tasks 531 option $DB:$magicDSToCleanup_DB 532 $run = $run -dbname $DB:$magicDSToCleanup_DB 533 534 # only bump database number after we have gone through all of the stages 535 $magicDSToCleanup_DB ++ 536 if ($magicDSToCleanup_DB >= $DB:n) set magicDSToCleanup_DB = 0 537 end 538 add_poll_args run 539 add_poll_labels run 540 command $run 541 end 542 543 # success 544 task.exit 0 545 # convert 'stdout' to book format 546 ipptool2book stdout magicDSToCleanup -key magic_ds_id -uniq -setword dbname $options:0 -setword pantaskState INIT 547 if ($VERBOSE > 2) 548 book listbook magicDSToCleanup 549 end 550 551 # delete existing entries in the appropriate pantaskStates 552 process_cleanup magicDSToCleanup 553 end 554 555 # locked list 556 task.exit default 557 showcommand failure 558 end 559 560 task.exit crash 561 showcommand crash 562 end 563 564 # operation times out? 565 task.exit timeout 566 showcommand timeout 567 end 568 end 569 570 task destreak.cleanup.run 571 periods -poll $RUNPOLL 572 periods -exec $RUNEXEC 573 periods -timeout 60 574 active false 575 576 task.exec 577 stdout $LOGSUBDIR/destreak.cleanup.run.log 578 stderr $LOGSUBDIR/destreak.cleanup.run.log 579 580 book npages magicDSToCleanup -var N 581 if ($N == 0) break 582 if ($NETWORK == 0) break 583 584 # look for new images (pantaskState == INIT) 585 book getpage magicDSToCleanup 0 -var pageName -key pantaskState INIT 586 if ("$pageName" == "NULL") break 587 588 book setword magicDSToCleanup $pageName pantaskState RUN 589 book getword magicDSToCleanup $pageName magic_ds_id -var MAGIC_DS_ID 590 book getword magicDSToCleanup $pageName camera -var CAMERA 591 book getword magicDSToCleanup $pageName outroot -var OUTROOT 592 book getword magicDSToCleanup $pageName dbname -var DBNAME 593 594 sprintf logfile "%s/mds.%s.cleanup.log" $OUTROOT $MAGIC_DS_ID 595 596 host anyhost 597 598 $run = magic_destreak_cleanup.pl --magic_ds_id $MAGIC_DS_ID --camera $CAMERA --logfile $logfile 599 600 add_standard_args run 601 602 # save the pageName for future reference below 603 options $pageName 604 605 # create the command line 606 if ($VERBOSE > 1) 607 echo command $run 608 end 609 command $run 610 end 611 612 # default exit status 613 task.exit 0 614 process_exit magicDSToCleanup $options:0 $JOB_STATUS 615 end 616 617 # locked list 618 task.exit default 619 showcommand failure 620 process_exit magicDSToCleanup $options:0 $JOB_STATUS 621 end 622 623 task.exit crash 624 showcommand crash 625 book setword magicDSToCleanup $options:0 pantaskState CRASH 626 end 627 628 # operation timed out? 629 task.exit timeout 630 showcommand timeout 631 book setword magicDSToCleanup $options:0 pantaskState TIMEOUT 632 end 633 end 634
Note:
See TracChangeset
for help on using the changeset viewer.
