]> Sergey Matveev's repositories - public-inbox.git/commitdiff
v2writable: fix rethread cleanup
authorEric Wong <e@yhbt.net>
Fri, 7 Aug 2020 01:14:03 +0000 (01:14 +0000)
committerEric Wong <e@yhbt.net>
Fri, 7 Aug 2020 23:45:37 +0000 (23:45 +0000)
We need to drop old ghosts properly while inside the
transaction, otherwise it becomes a no-op.  This isn't a big
deal, as it only results in a few dangling DB rows and a
small amount of wasted space.

lib/PublicInbox/V2Writable.pm

index 344edbbad2010668fd8170f7af9b28c9a9e4fbfa..f98afa61374c0eef44e36e98fdda18d039cb21a1 100644 (file)
@@ -1244,13 +1244,13 @@ sub index_sync {
        }
        # work forwards through history
        index_epoch($self, $sync, $_) for (0..$epoch_max);
+       $self->{over}->rethread_done($opt);
        $self->done;
 
        if (my $nr = $sync->{nr}) {
                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}) {