Changeset 24038 for trunk/ippTasks/receive.pro
- Timestamp:
- May 1, 2009, 5:28:52 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/ippTasks/receive.pro (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTasks/receive.pro
r23899 r24038 20 20 ### 21 21 ### receivetool -revert: remove result after something goes wrong 22 ### 23 ### receivetool -toadvance: filesets for which all files have been downloaded and are ready 24 ### to complete processing 22 25 23 26 # test for required global variables … … 27 30 book init receiveFileset 28 31 book init receiveFile 32 book init receiveAdvance 29 33 30 34 macro receive.status … … 32 36 book listbook receiveFileset 33 37 book listbook receiveFile 38 book listbook receiveAdvance 34 39 end 35 40 … … 38 43 book init receiveFileset 39 44 book init receiveFile 45 book init receiveAdvance 40 46 end 41 47 … … 59 65 active true 60 66 end 67 task receive.advance.load 68 active true 69 end 70 task receive.advance.run 71 active true 72 end 61 73 end 62 74 … … 80 92 active false 81 93 end 94 task receive.advance.load 95 active false 96 end 97 task receive.advance.run 98 active false 99 end 82 100 end 83 101 … … 85 103 # this variable will cycle through the known database names 86 104 $receive_DB = 0 105 $receive_Advance_DB = 0 87 106 88 107 task receive.source.load … … 380 399 book getword receiveFile $pageName product -var PRODUCT 381 400 book getword receiveFile $pageName fileset -var FILESET 401 book getword receiveFile $pageName fileset_id -var FILESET_ID 382 402 book getword receiveFile $pageName file -var FILE 383 403 book getword receiveFile $pageName workdir -var WORKDIR … … 388 408 stderr $LOGDIR/receive.file.log 389 409 390 $run = receive_file.pl --file_id $FILE_ID --source $SOURCE --product $PRODUCT --fileset $FILESET --file $FILE --workdir $WORKDIR410 $run = receive_file.pl --file_id $FILE_ID --source $SOURCE --product $PRODUCT --fileset $FILESET --fileset_id $FILESET_ID --file $FILE --workdir $WORKDIR 391 411 add_standard_args run 392 412 … … 419 439 end 420 440 end 441 442 task receive.advance.load 443 host local 444 445 periods -poll $LOADPOLL 446 periods -exec $LOADEXEC 447 periods -timeout 30 448 npending 1 449 450 stdout NULL 451 stderr $LOGDIR/receive.advance.log 452 453 task.exec 454 $run = receivetool -toadvance 455 if ($DB:n == 0) 456 option DEFAULT 457 else 458 # save the DB name for the exit tasks 459 option $DB:$receive_Advance_DB 460 $run = $run -dbname $DB:$receive_Advance_DB 461 $receive_Advance_DB ++ 462 if ($receive_Advance_DB >= $DB:n) set receive_Advance_DB = 0 463 end 464 add_poll_args run 465 command $run 466 end 467 468 # success 469 task.exit 0 470 # convert 'stdout' to book format 471 ipptool2book stdout receiveAdvance -key fileset_id -uniq -setword dbname $options:0 -setword pantaskState INIT 472 if ($VERBOSE > 2) 473 book listbook receiveAdvance 474 end 475 476 # delete existing entries in the appropriate pantaskStates 477 process_cleanup receiveAdvance 478 end 479 480 # locked list 481 task.exit default 482 showcommand failure 483 end 484 485 task.exit crash 486 showcommand crash 487 end 488 489 # operation times out? 490 task.exit timeout 491 showcommand timeout 492 end 493 end 494 495 task receive.advance.run 496 periods -poll $RUNPOLL 497 periods -exec $RUNEXEC 498 periods -timeout 60 499 500 task.exec 501 book npages receiveAdvance -var N 502 if ($N == 0) break 503 if ($NETWORK == 0) break 504 505 book getpage receiveAdvance 0 -var pageName -key pantaskState INIT 506 if ("$pageName" == "NULL") break 507 508 book setword receiveAdvance $pageName pantaskState RUN 509 book getword receiveAdvance $pageName fileset_id -var FILESET_ID 510 book getword receiveAdvance $pageName fileset -var FILESET 511 book getword receiveAdvance $pageName dbinfo_uri -var DBINFO_URI 512 book getword receiveAdvance $pageName status_product -var STATUS_PRODUCT 513 book getword receiveAdvance $pageName ds_dbname -var DS_DBNAME 514 book getword receiveAdvance $pageName ds_dbhost -var DS_DBHOST 515 book getword receiveAdvance $pageName dbname -var DBNAME 516 517 stdout $LOGDIR/receive.advance.log 518 stderr $LOGDIR/receive.advance.log 519 520 $run = receive_advance.pl --fileset_id $FILESET_ID --fileset $FILESET --dbinfo_uri $DBINFO_URI --status_product $STATUS_PRODUCT --ds_dbname $DS_DBNAME --ds_dbhost $DS_DBHOST 521 add_standard_args run 522 523 # save the pageName for future reference below 524 options $pageName 525 526 # create the command line 527 if ($VERBOSE > 1) 528 echo command $run 529 end 530 command $run 531 end 532 533 # default exit status 534 task.exit default 535 process_exit receiveAdvance $options:0 $JOB_STATUS 536 end 537 538 # locked list 539 task.exit crash 540 showcommand crash 541 echo "hostname: $JOB_HOSTNAME" 542 book setword receiveAdvance $options:0 pantaskState CRASH 543 end 544 545 # operation timed out? 546 task.exit timeout 547 showcommand timeout 548 book setword receiveAdvance $options:0 pantaskState TIMEOUT 549 end 550 end
Note:
See TracChangeset
for help on using the changeset viewer.
