Changeset 19265 for trunk/pstamp/scripts/pstamp_queue_requests.pl
- Timestamp:
- Aug 28, 2008, 2:06:45 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/pstamp/scripts/pstamp_queue_requests.pl (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pstamp/scripts/pstamp_queue_requests.pl
r18623 r19265 22 22 'verbose' => \$verbose, 23 23 'dbname=s' => \$dbname, 24 'limit= s' => \$limit,24 'limit=i' => \$limit, 25 25 ); 26 26 … … 119 119 my $out_buf = join("", @$stdout_buf); 120 120 # split raw output into lines 121 # XXX: why do I think that i need the map?122 #my @lines = map {split "\n"} $raw_output;123 121 @lines = split /^/, $out_buf; 124 122 } … … 127 125 # each line contains a fileset 128 126 # 129 # XXX: we probably should set a limit on the number of these we process 130 # otherwise this could take a long time and the task could time out 127 128 # number that we've processed 129 my $numFilesets = 0; 131 130 foreach my $line (@lines) { 132 131 # parse the line into fields split by whitespace 133 132 my ($uri, $fs_name, $date, $type) = split " ", $line; 134 133 134 # skip comment lines 135 135 next if ( $uri =~ /^#.*/); 136 137 $numFilesets++; 136 138 137 139 my @files; … … 163 165 my $command = "$pstamptool -addreq -uri $req_uri -ds_id $ds_id"; 164 166 $command .= " -dbname $dbname" if $dbname; 167 165 168 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 166 169 run(command => $command, verbose => $verbose); 167 unless ($success) { 168 # XXX: what do we do now?169 die("Unable to perform $command: $error_code");170 }170 171 unless ($success) { 172 die("Unable to perform $command: $error_code"); 173 } 171 174 } 172 $lastFileset = $fs_name;173 175 } 176 $lastFileset = $fs_name; 177 last if ($numFilesets >= $limit); 174 178 } 175 179 176 180 ## now update the last_fileset column in pstampDataStore 177 ## XXX: we should probably do this before we process the fileset. Otherwise 178 ## if we get an error from pstamptool we'll get stuck processing it over and over. 181 ## XXX: we should perhaps do this while processing each fileset so that if a later 182 ## one has an error we don't get repeats. 183 179 184 if ($lastFileset) { 180 185 # print "last fileset: $lastFileset\n";
Note:
See TracChangeset
for help on using the changeset viewer.
