Changeset 18683 for trunk/ippTasks/automate.pro
- Timestamp:
- Jul 23, 2008, 1:55:39 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/ippTasks/automate.pro (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTasks/automate.pro
r17605 r18683 37 37 ipptool2book tmp automate -key name -uniq -setword pantaskState INIT.BLOCK 38 38 queuedelete tmp 39 40 ## Pull out the ones that are to be run regularly 41 local npages 42 book npages automate -var npages 43 for i 0 $npages 44 book getpage automate $i -var pageName 45 if ("$pageName" != "NULL") 46 book getword automate $pageName regular -var regularCommand 47 if ("$regularCommand" != "NULL") 48 book setword automate $pageName pantaskState INIT.REGULAR 49 end 50 end 51 end 52 39 53 end 40 54 … … 49 63 active true 50 64 end 65 task automate.regular 66 active true 67 end 51 68 end 52 69 … … 59 76 end 60 77 task automate.launch 78 active false 79 end 80 task automate.regular 61 81 active false 62 82 end … … 335 355 end 336 356 357 358 $automate_Nregular = 0 359 task automate.regular 360 host local 361 362 periods -poll 1 363 periods -exec 5 364 periods -timeout 30 365 active true 366 npending 1 367 368 task.exec 369 local Npage pageName 370 371 # how many pages are waiting to be started? 372 book npages automate -var Npage -key pantaskState INIT.REGULAR 373 if ($Npage == 0) 374 if ($VERBOSE >= 2) 375 echo "no entries in INIT.REGULAR state" 376 end 377 break 378 end 379 380 # cycle over the number of INIT.REGULAR pages: no point to loop over the others 381 $automate_Nregular ++ 382 if ($automate_Nregular >= $Npage) set automate_Nregular = 0 383 384 # search the automate book for an entry which is unstarted (state INIT.REGULAR) 385 book getpage automate $automate_Nregular -var pageName -key pantaskState INIT.REGULAR 386 if ("$pageName" == "NULL") 387 if ($VERBOSE >= 2) 388 echo "entry $automate_Nregular not in INIT.REGULAR state" 389 end 390 break 391 end 392 393 book getword automate $pageName regular -var regularCommand 394 if (("$regularCommand" == "NULL") || ("$regularCommand" == "NONE")) 395 if ($VERBOSE >= 2) 396 echo "Warning: $pageName has no regular command" 397 end 398 break 399 end 400 401 book setword automate $pageName pantaskState RUN.REGULAR 402 403 if ($VERBOSE >= 2) 404 echo "starting automate regular for $pageName" 405 echo "command $regularCommand" 406 end 407 408 options $pageName 409 command $regularCommand 410 end 411 412 task.exit $EXIT_SUCCESS 413 local pageName Npage 414 415 $pageName = $options:0 416 417 book setword automate $pageName pantaskState INIT.REGULAR 418 end 419 420 # all failures here (what state?) 421 task.exit default 422 showcommand failure 423 book setword automate $pageName pantaskState FAIL.REGULAR 424 end 425 426 # operation times out? 427 task.exit timeout 428 showcommand timeout 429 book setword automate $pageName pantaskState INIT.REGULAR 430 end 431 end 432
Note:
See TracChangeset
for help on using the changeset viewer.
