Changeset 10
- Timestamp:
- 11/20/10 20:31:08 (14 years ago)
- Location:
- web/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
web/trunk/bin/sophie_scan
r9 r10 70 70 if (my $pid = fork()) { 71 71 } else { 72 foreach my $pathkey (@pkey) { 73 my @delta = Sophie::Base::RpmsPath->new($pathkey) 74 ->find_delta; 75 while (my @d = splice(@delta, 0, 25)) { 76 my $path = Sophie::Base::RpmsPath->new($pathkey); 77 $path->update_content(@d); 78 $path->db->disconnect; 72 73 74 my $NB_PAR = 2; 75 my @split; 76 my $div = @pkey / $NB_PAR; 77 78 for (my $i = 0; $i < $NB_PAR - 1; $i++) { 79 $split[$i] = [ splice(@pkey, 0, $div) ]; 80 } 81 $split[$NB_PAR -1] = [ @pkey ]; 82 foreach my $job (@split) { 83 @{$job || []} or next; 84 85 if (fork()) { 86 } else { 87 88 foreach my $pathkey (@{ $job }) { 89 my @delta = Sophie::Base::RpmsPath->new($pathkey) 90 ->find_delta; 91 while (my @d = splice(@delta, 0, 25)) { 92 my $path = Sophie::Base::RpmsPath->new($pathkey); 93 $path->update_content(@d); 94 $path->db->disconnect; 95 } 96 Sophie::Base::RpmsPath->new($pathkey)->set_updated; 97 } 98 exit(0); 79 99 } 80 Sophie::Base::RpmsPath->new($pathkey)->set_updated;81 100 } 82 exit(0);101 1 while(waitpid(-1, 0) <= 0); 83 102 } 84 103 return 1; -
web/trunk/lib/Sophie/Base/Header.pm
r2 r10 89 89 $content = $enc->decode($content); 90 90 91 $self->db->pg_savepoint('FILECONTENT'); 91 92 $add_content->execute( 92 93 $enc && ref $enc ? encode('utf8', $enc->decode($content)) : $content, 93 94 $$self, 94 $entry->{count}); 95 $entry->{count}) or do { 96 $self->db->pg_rollback_to('FILECONTENT'); 97 }; 95 98 } else { 96 99 }
Note: See TracChangeset
for help on using the changeset viewer.