From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 6FB172008D for ; Tue, 27 Oct 2020 07:54:58 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 29/52] v2writable: move size check init to sync_prepare Date: Tue, 27 Oct 2020 07:54:30 +0000 Message-Id: <20201027075453.19163-30-e@80x24.org> In-Reply-To: <20201027075453.19163-1-e@80x24.org> References: <20201027075453.19163-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: This will let us use it from ExtSearchIdx. --- lib/PublicInbox/V2Writable.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/PublicInbox/V2Writable.pm b/lib/PublicInbox/V2Writable.pm index ca60f2a1..d417b125 100644 --- a/lib/PublicInbox/V2Writable.pm +++ b/lib/PublicInbox/V2Writable.pm @@ -1038,6 +1038,9 @@ sub sync_prepare ($$) { # without {reindex} my $reindex_heads = $self->last_commits($sync) if $sync->{reindex}; + if ($sync->{max_size} = $sync->{-opt}->{max_size}) { + $sync->{index_oid} = $self->can('index_oid'); + } for (my $i = $sync->{epoch_max}; $i >= 0; $i--) { my $git_dir = $sync->{ibx}->git_dir_n($i); -d $git_dir or next; # missing epochs are fine @@ -1312,9 +1315,6 @@ sub index_sync { $art_beg++ if defined($art_beg); } } - if ($sync->{max_size} = $opt->{max_size}) { - $sync->{index_oid} = $self->can('index_oid'); - } # work forwards through history index_epoch($self, $sync, $_) for (0..$epoch_max); $self->{oidx}->rethread_done($opt);