Changeset 29094
- Timestamp:
- Sep 1, 2010, 1:14:42 PM (16 years ago)
- Location:
- trunk/ippToPsps/perl
- Files:
-
- 1 added
- 1 edited
-
checkOdmStatus.pl (modified) (6 diffs)
-
ippToPsps/BatchManager.pm (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippToPsps/perl/checkOdmStatus.pl
r29093 r29094 5 5 6 6 use LWP::UserAgent; 7 use IPC::Cmd 0.36 qw( can_run run );8 use IPC::Cmd 0.36 qw( can_run run );9 7 use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt ); 10 8 use XML::LibXML; … … 12 10 use ippToPsps::IppToPspsDb; 13 11 use ippToPsps::Datastore; 12 use ippToPsps::BatchManager; 14 13 15 14 my $singleBatch = undef; … … 61 60 my $datastore = new ippToPsps::Datastore($product, 0, 0); 62 61 my $ippToPspsDb = new ippToPsps::IppToPspsDb("ippToPsps", "ippdb01", "ipp", "ipp", $verbose, $save_temps); 62 my $batchManager = new ippToPsps::BatchManager($ippToPspsDb, $filePath, $verbose, $save_temps); 63 63 my $odmUrl = "http://web01.psps.ifa.hawaii.edu/a01/OdmWebService/OdmWebService.asmx/GetBatchStatus"; 64 64 my $ua = LWP::UserAgent->new; … … 102 102 $numBatchesToCheck++; 103 103 104 my $batchName = getBatchName($batchId);104 my $batchName = $batchManager->getBatchName($batchId); 105 105 106 106 # if not merged then update by polling ODM for status … … 119 119 } 120 120 } 121 122 121 # if merged and already removed from datastore then delete files 123 122 if (defined $filePath && $merged && $deleted) { 124 123 125 print "$command\n"; 126 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 127 run(command => $command, verbose => $verbose); 128 if (!$success) {print "* Unable to run: $command\n";} 129 else {$numDeleted++;} 124 if($batchManager->deleteBatch($batchId)) {$numDeleted++;} 130 125 } 131 126 … … 152 147 ######################################################################################## 153 148 # 154 # Returns batch name from batch_id TODO needs to be a batch class155 #156 ########################################################################################157 sub getBatchName {158 my ($batchId) = @_;159 160 return sprintf("B%08d", $batchId);161 }162 163 ########################################################################################164 #165 149 # Check a single batch 166 150 #
Note:
See TracChangeset
for help on using the changeset viewer.
