Changeset 23176
- Timestamp:
- Mar 4, 2009, 8:53:53 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/eam_branch_20090303/ippScripts/scripts/ipp_cleanup.pl
r22750 r23176 45 45 defined $mode; 46 46 47 # $mode must be one of "goto_cleaned", "goto_scrubbed", or "goto_purged" 48 # goto_cleaned and goto_scrubbed both result in 'cleaned': scrubbed allows chips without config files to 49 # be cleaned (they cannot be recovered, but the small data is left behind) 47 # $mode must be one of "goto_cleaned", "goto_scrubbed", or 48 # "goto_purged" goto_cleaned and goto_scrubbed both result in 49 # 'cleaned' on success ('scrubbed' allows chips without config files 50 # to be cleaned; they cannot be recovered, but the small data is left 51 # behind). XXX make 'scrubbed' a data_state? 52 50 53 unless (($mode eq "goto_cleaned") || ($mode eq "goto_scrubbed") || ($mode eq "goto_purged")) { 51 54 die "invalid cleanup mode $mode\n"; 52 55 } 56 57 my $error_state; 58 if ($mode eq "goto_cleaned") { $error_state = "error_cleaned"; } 59 if ($mode eq "goto_scrubbed") { $error_state = "error_scrubbed"; } 60 if ($mode eq "goto_purged") { $error_state = "error_purged"; } 61 53 62 54 63 my %stages = ( chip => 1, camera => 1, fake => 1, warp => 1, stack => 1, diff => 1); … … 150 159 } 151 160 } else { 152 # if an error happens for one chip, the chipRun will stay in goto_*, but the chips will stop be run153 my $command = "$chiptool -updateprocessedimfile -chip_id $stage_id -class_id $class_id - code 1";161 # if an error happens for a chip, the chipRun will stay in goto_*, but the chips will go to error_* (matching the goto_*) 162 my $command = "$chiptool -updateprocessedimfile -chip_id $stage_id -class_id $class_id -set_state $error_state"; 154 163 $command .= " -dbname $dbname" if defined $dbname; 155 164 … … 218 227 219 228 if ($status) { 220 my $command = "$camtool -cam_id $stage_id -updaterun";229 my $command; 221 230 if ($mode eq "goto_cleaned") { 222 $command .= " -state cleaned"; 223 } else { 224 $command .= " -state purged"; 231 $command = "$camtool -updaterun -cam_id $stage_id -set_state cleaned"; 232 } 233 if ($mode eq "goto_scrubbed") { 234 $command = "$camtool -updaterun -cam_id $stage_id -set_state cleaned"; 235 } 236 if ($mode eq "goto_purged") { 237 $command = "$camtool -updaterun -cam_id $stage_id -set_state purged"; 225 238 } 226 239 $command .= " -dbname $dbname" if defined $dbname; … … 232 245 } 233 246 } else { 234 my $command = "$camtool -updateprocessedexp -cam_id $stage_id -code 1"; 247 # since 'camera' has only a single imfile, we can just update the run 248 my $command = "$camtool -updaterun -cam_id $stage_id -set_state $error_state"; 235 249 $command .= " -dbname $dbname" if defined $dbname; 236 250 … … 321 335 } 322 336 } else { 323 # XXX: -updateskyfile mode does not exist, need to add it 324 my $command = "$warptool -updateskyfile -warp_id $stage_id -skycell_id $skycell_id -code 1"; 337 my $command = "$warptool -updateskyfile -warp_id $stage_id -skycell_id $skycell_id -set_state $error_state"; 325 338 $command .= " -dbname $dbname" if defined $dbname; 326 339 … … 339 352 # left TODO 340 353 # fake : faketool : -pendingcleanupimfile (loop over imfiles) 341 # stack: stacktool : -pendingcleanupskyfile (loop over skyfiles)342 # diff: difftool : -pendingcleanupskyfile 354 # stack: stacktool : -pendingcleanupskyfile 355 # diff: difftool : -pendingcleanupskyfile (loop over skyfiles) 343 356 344 357 die "ipp_cleanup.pl -stage $stage not yet implemented\n"; … … 369 382 } 370 383 384 # XXX we currently do not set the error state in the db on my_die 371 385 sub my_die 372 386 {
Note:
See TracChangeset
for help on using the changeset viewer.
