]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/V2Writable.pm
index: support --rethread switch to fix old indices
[public-inbox.git] / lib / PublicInbox / V2Writable.pm
index 0582dd5e32e8e87484c64d01447253af221e4a0c..16556ddc209d7ab4d3cdcfc2d3d5fd91c4aa052e 100644 (file)
@@ -1308,6 +1308,7 @@ sub index_sync {
        my $latest = git_dir_latest($self, \$epoch_max);
        return unless defined $latest;
        $self->idx_init($opt); # acquire lock
+       $self->{over}->rethread_prepare($opt);
        my $sync = {
                D => {}, # "$mid\0$chash" => $oid
                unindex_range => {}, # EPOCH => oid_old..oid_new
@@ -1370,12 +1371,13 @@ sub index_sync {
                my $pr = $sync->{-opt}->{-progress};
                $pr->('all.git '.sprintf($sync->{-regen_fmt}, $nr)) if $pr;
        }
+       $self->{over}->rethread_done($opt);
 
        # reindex does not pick up new changes, so we rerun w/o it:
        if ($opt->{reindex}) {
                my %again = %$opt;
                $sync = undef;
-               delete @again{qw(reindex -skip_lock)};
+               delete @again{qw(rethread reindex -skip_lock)};
                index_sync($self, \%again);
        }
 }