Changeset 25027 for branches/pap/ippTasks/fake.pro
- Timestamp:
- Aug 7, 2009, 4:08:25 PM (17 years ago)
- Location:
- branches/pap
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
ippTasks/fake.pro (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/pap
- Property svn:mergeinfo changed
-
branches/pap/ippTasks/fake.pro
r23282 r25027 7 7 8 8 book init fakePendingImfile 9 book init fakePendingCleanup10 9 11 10 macro fake.status 12 11 book listbook fakePendingImfile 13 book listbook fakePendingCleanup14 12 end 15 13 16 14 macro fake.reset 17 15 book init fakePendingImfile 18 book init fakePendingCleanup19 16 end 20 17 … … 43 40 end 44 41 45 macro fake.cleanup.on46 task fake.cleanup.load47 active true48 end49 task fake.cleanup.run50 active true51 end52 end53 54 macro fake.cleanup.off55 task fake.cleanup.load56 active false57 end58 task fake.cleanup.run59 active false60 end61 end62 63 42 # this variable will cycle through the known database names 64 43 $fakeImfile_DB = 0 44 $fake_revert_DB = 0 65 45 66 46 # select images ready for fake analysis … … 79 59 80 60 task.exec 61 if ($LABEL:n == 0) break 81 62 $run = faketool -pendingimfile 82 63 if ($DB:n == 0) … … 90 71 end 91 72 add_poll_args run 73 add_poll_labels run 92 74 command $run 93 75 end … … 123 105 124 106 task.exec 107 # fake is fast, so generate a bunch of commands in a row 125 108 book npages fakePendingImfile -var N 126 if ($N == 0) break 109 if ($N == 0) 110 periods -exec $RUNEXEC 111 break 112 end 113 periods -exec 0.05 114 127 115 if ($NETWORK == 0) break 128 116 … … 198 186 periods -poll $LOADPOLL 199 187 periods -exec $LOADEXEC 200 periods -timeout 30 188 periods -exec 30 189 periods -timeout 60 201 190 npending 1 202 191 … … 205 194 206 195 task.exec 196 if ($LABEL:n == 0) break 207 197 $run = faketool -advanceexp -limit 10 208 198 if ($DB:n == 0) … … 216 206 end 217 207 add_poll_args run 208 add_poll_labels run 218 209 command $run 219 210 end … … 238 229 end 239 230 240 # this variable will cycle through the known database names 241 $fake_cleanup_DB = 0 242 243 # select images ready for fake analysis 244 # new entries are added to fakePendingImfile 245 # skip already-present entries 246 task fake.cleanup.load 231 task fake.revert 247 232 host local 248 233 249 periods -poll $LOADPOLL250 periods -exec $LOADEXEC251 periods -timeout 30234 periods -poll 5.0 235 periods -exec 60.0 236 periods -timeout 120.0 252 237 npending 1 253 active false254 238 255 239 stdout NULL 256 stderr $LOGDIR/fake.cleanup.log 257 258 task.exec 259 $run = faketool -pendingcleanuprun 240 stderr $LOGDIR/revert.log 241 242 task.exec 243 if ($LABEL:n == 0) break 244 $run = faketool -revertprocessedimfile 260 245 if ($DB:n == 0) 261 246 option DEFAULT 262 command263 247 else 264 248 # save the DB name for the exit tasks 265 option $DB:$fake_ cleanup_DB266 $run = $run -dbname $DB:$fake_ cleanup_DB267 $fake_ cleanup_DB ++268 if ($fake_ cleanup_DB >= $DB:n) set fake_cleanup_DB = 0269 end 270 add_poll_ args run249 option $DB:$fake_revert_DB 250 $run = $run -dbname $DB:$fake_revert_DB 251 $fake_revert_DB ++ 252 if ($fake_revert_DB >= $DB:n) set fake_revert_DB = 0 253 end 254 add_poll_labels run 271 255 command $run 272 256 end … … 274 258 # success 275 259 task.exit 0 276 # convert 'stdout' to book format277 ipptool2book stdout fakePendingCleanup -key fake_id -uniq -setword dbname $options:0 -setword pantaskState INIT278 if ($VERBOSE > 2)279 book listbook fakePendingCleanup280 end281 282 # delete existing entries in the appropriate pantaskStates283 process_cleanup fakePendingCleanup284 260 end 285 261 … … 298 274 end 299 275 end 300 301 # run the ipp_cleanup.pl script on pending images302 task fake.cleanup.run303 periods -poll $RUNPOLL304 periods -exec $RUNEXEC305 periods -timeout 60306 active false307 308 task.exec309 book npages fakePendingCleanup -var N310 if ($N == 0) break311 if ($NETWORK == 0) break312 313 # look for new images in fakePendingCleanup (pantaskState == INIT)314 book getpage fakePendingCleanup 0 -var pageName -key pantaskState INIT315 if ("$pageName" == "NULL") break316 317 book setword fakePendingCleanup $pageName pantaskState RUN318 book getword fakePendingCleanup $pageName camera -var CAMERA319 book getword fakePendingCleanup $pageName state -var CLEANUP_MODE320 book getword fakePendingCleanup $pageName fake_id -var FAKE_ID321 book getword fakePendingCleanup $pageName dbname -var DBNAME322 323 # specify choice of local or remote host based on camera and fake (class_id)324 set.host.for.camera $CAMERA FPA325 326 stdout $LOGDIR/fake.cleanup.log327 stderr $LOGDIR/fake.cleanup.log328 329 # XXX is everything listed here needed?330 $run = ipp_cleanup.pl --stage fake --stage_id $FAKE_ID --camera $CAMERA --mode $CLEANUP_MODE331 add_standard_args run332 333 # save the pageName for future reference below334 options $pageName335 336 # create the command line337 if ($VERBOSE > 1)338 echo command $run339 end340 command $run341 end342 343 # default exit status344 task.exit default345 process_exit fakePendingCleanup $options:0 $JOB_STATUS346 end347 348 task.exit crash349 showcommand crash350 book setword fakePendingCleanup $options:0 pantaskState CRASH351 end352 353 # operation timed out?354 task.exit timeout355 showcommand timeout356 book setword fakePendingCleanup $options:0 pantaskState TIMEOUT357 end358 end
Note:
See TracChangeset
for help on using the changeset viewer.
