diff options
-rw-r--r-- | lib/PublicInbox/Import.pm | 5 | ||||
-rwxr-xr-x | script/public-inbox-learn | 4 | ||||
-rwxr-xr-x | script/public-inbox-mda | 9 |
3 files changed, 5 insertions, 13 deletions
diff --git a/lib/PublicInbox/Import.pm b/lib/PublicInbox/Import.pm index e3d65f4a..c13d4834 100644 --- a/lib/PublicInbox/Import.pm +++ b/lib/PublicInbox/Import.pm @@ -226,6 +226,11 @@ sub done { waitpid($pid, 0) == $pid or die 'update-server-info did not finish'; $? == 0 or die "failed to update-server-info: $?\n"; + + eval { + require PublicInbox::SearchIdx; + PublicInbox::SearchIdx->new($git_dir, 2)->index_sync; + }; } my $lockfh = delete $self->{lockfh} or die "BUG: not locked: $!"; diff --git a/script/public-inbox-learn b/script/public-inbox-learn index 817fd5e9..b05ef056 100755 --- a/script/public-inbox-learn +++ b/script/public-inbox-learn @@ -84,10 +84,6 @@ foreach my $recipient (keys %dests) { $im->add($mime); } $im->done; - eval { - require PublicInbox::SearchIdx; - PublicInbox::SearchIdx->new($git_dir, 2)->index_sync; - }; } if ($err) { diff --git a/script/public-inbox-mda b/script/public-inbox-mda index 26b70cfb..145aa710 100755 --- a/script/public-inbox-mda +++ b/script/public-inbox-mda @@ -79,7 +79,6 @@ if (ref($ret) && $ret->isa('Email::MIME')) { # filter altered message } # else { accept PublicInbox::MDA->set_list_headers($mime, $dst); -END { index_sync($main_repo) if $? == 0 }; my $git = PublicInbox::Git->new($main_repo); my $im = PublicInbox::Import->new($git, $dst->{name}, $recipient); if (defined $im->add($mime)) { @@ -107,11 +106,3 @@ sub do_spamc { ($? || $$out eq '') ? 0 : 1; } - -sub index_sync { - my ($git_dir) = @_; - eval { - require PublicInbox::SearchIdx; - PublicInbox::SearchIdx->new($git_dir, 2)->index_sync; - }; -} |