IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 29723


Ignore:
Timestamp:
Nov 9, 2010, 2:51:43 PM (16 years ago)
Author:
bills
Message:

from trunk remove publish.trigger add survey task

Location:
tags/ipp-20101029/ippTasks
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • tags/ipp-20101029/ippTasks/publish.pro

    r29507 r29723  
    1515
    1616macro publish.on
    17   task publish.trigger
    18     active true
    19   end
    2017  task publish.load
    2118    active true
     
    3027
    3128macro publish.off
    32   task publish.trigger
    33     active false
    34   end
    3529  task publish.load
    3630    active false
     
    5953
    6054# this variable will cycle through the known database names
    61 $publish_trigger_DB = 0
    6255$publish_load_DB = 0
    6356$publish_revert_DB = 0
    64 
    65 task           publish.trigger
    66   host         local
    67 
    68   periods      -poll $LOADPOLL
    69   periods      -exec $LOADEXEC
    70   periods      -timeout 30
    71   npending     1
    72 
    73   stdout NULL
    74   stderr $LOGDIR/publish.trigger.log
    75 
    76   task.exec
    77     if ($LABEL:n == 0) break
    78     #otherwise everything will be queued when there is no label.
    79     $run = pubtool -definerun
    80     if ($DB:n == 0)
    81       option DEFAULT
    82     else
    83       # save the DB name for the exit tasks
    84       option $DB:$publish_trigger_DB
    85       $run = $run -dbname $DB:$publish_trigger_DB
    86       $publish_trigger_DB ++
    87       if ($publish_trigger_DB >= $DB:n) set publish_trigger_DB = 0
    88     end
    89     add_poll_labels run
    90     command $run
    91   end
    92 
    93   # success
    94   task.exit    0
    95   end
    96 
    97   # locked list
    98   task.exit    default
    99     showcommand failure
    100   end
    101 
    102   task.exit    crash
    103     showcommand crash
    104   end
    105 
    106   # operation times out?
    107   task.exit    timeout
    108     showcommand timeout
    109   end
    110 end
    11157
    11258task           publish.load
  • tags/ipp-20101029/ippTasks/survey.pro

    r29587 r29723  
    3232 book create SURVEY_CHIP_BG
    3333 book create SURVEY_WARP_BG
     34 book create SURVEY_PUBLISH
    3435 $haveSurveyBooks = TRUE
    3536end
     
    4445$SURVEY_CHIP_BG_DB = 0
    4546$SURVEY_WARP_BG_DB = 0
     47$SURVEY_PUBLISH_DB = 0
    4648
    4749$SURVEY_EXEC = 120
     
    7779    active true
    7880  end
     81  task survey.publish
     82    active true
     83  end
    7984end
    8085
     
    105110  end
    106111  task survey.warp.bg
     112    active false
     113  end
     114  task survey.publish
    107115    active false
    108116  end
     
    355363  book listbook SURVEY_WARP_BG
    356364end
     365
     366# user functions to manipulate publish labels
     367macro survey.add.publish
     368  if ($0 != 3)
     369    echo "USAGE: survey.add.publish (label) (client_id)"
     370    break
     371  end
     372  book newpage SURVEY_PUBLISH $1
     373  book setword SURVEY_PUBLISH $1 CLIENT_ID $2
     374  book setword SURVEY_PUBLISH $1 STATE PENDING
     375end
     376
     377macro survey.del.publish
     378  if ($0 != 2)
     379    echo "USAGE: survey.del.publish (label)"
     380    break
     381  end
     382  book delpage SURVEY_PUBLISH $1
     383end
     384
     385macro survey.show.publish
     386  if ($0 != 1)
     387    echo "USAGE: survey.show.publish"
     388    break
     389  end
     390  book listbook SURVEY_PUBLISH
     391end
     392
    357393
    358394task survey.diff
     
    579615    end
    580616   
    581     echo $run
     617    # echo $run
    582618    command $run
    583619  end
     
    651687    end
    652688   
    653     echo $run
     689    # echo $run
    654690    command $run
    655691  end
     
    674710  end
    675711end
     712
    676713
    677714task survey.addstar
     
    723760   
    724761    $run = $run -definebyquery -destreaked -label $label -set_dvodb $dvodb -set_minidvodb_group $minidvodb_group -set_minidvodb -set_label $minidvodb_group
    725     echo $run
     762    # echo $run
    726763    command $run
    727764  end
     
    934971    end
    935972   
    936     echo $run
     973    # echo $run
    937974    command $run
    938975  end
     
    10041041    end
    10051042   
    1006     echo $run
     1043    # echo $run
    10071044    command $run
    10081045  end
     
    10271064  end
    10281065end
     1066
     1067task survey.publish
     1068  host local
     1069 
     1070  periods      -poll $SURVEY_POLL
     1071  periods      -exec $SURVEY_EXEC
     1072  periods      -timeout $SURVEY_TIMEOUT
     1073  npending     1
     1074
     1075  stdout $LOGDIR/survey.publish.log
     1076  stderr $LOGDIR/survey.publish.log
     1077
     1078  # generate publish runs
     1079  task.exec
     1080    book npages SURVEY_PUBLISH -var N
     1081    if ($N == 0)
     1082    #  echo "No labels for processing"
     1083      break
     1084    endif
     1085
     1086    book getpage SURVEY_PUBLISH 0 -var label -key STATE NEW
     1087    if ("$label" == "NULL")
     1088      # All labels have been done --- reset
     1089      echo "Resetting labels"
     1090      for i 0 $N
     1091        book getpage SURVEY_PUBLISH $i -var label
     1092        book setword SURVEY_PUBLISH $label STATE NEW
     1093      end
     1094      book getpage SURVEY_PUBLISH 0 -var label -key STATE NEW
     1095
     1096      # Select different database
     1097      $SURVEY_PUBLISH ++
     1098      if ($SURVEY_PUBLISH >= $DB:n) set SURVEY_PUBLISH = 0
     1099    end
     1100
     1101    book setword SURVEY_PUBLISH $label STATE DONE
     1102    book getword SURVEY_PUBLISH $label CLIENT_ID -var client_id
     1103 
     1104    $run = pubtool -definerun -label $label -client_id $client_id
     1105
     1106    if ($DB:n == 0)
     1107      option DEFAULT
     1108    else
     1109      $run = $run -dbname $DB:$SURVEY_PUBLISH
     1110      option $DB:$SURVEY_PUBLISH
     1111    end
     1112   
     1113    #echo $run
     1114    command echo $run
     1115  end
     1116
     1117  # success
     1118  task.exit    0
     1119    #echo "Success"
     1120  end
     1121
     1122  # locked list
     1123  task.exit    default
     1124    showcommand failure
     1125  end
     1126
     1127  task.exit    crash
     1128    showcommand crash
     1129  end
     1130
     1131  # operation times out?
     1132  task.exit    timeout
     1133    showcommand timeout
     1134  end
     1135end
Note: See TracChangeset for help on using the changeset viewer.