From c59caac2ee502dfd8b3acb1ca268c597719313f8 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 17 Aug 2015 08:19:44 +0000 Subject: public-inbox-{learn,mda}: automatically sync index We'll ignore errors, for now, but should eventually warn or log. And yes, this is a dirty, dirty hack but we'll fix this ASAP tomorrow. --- public-inbox-learn | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'public-inbox-learn') diff --git a/public-inbox-learn b/public-inbox-learn index d3a05abe..7f525f55 100755 --- a/public-inbox-learn +++ b/public-inbox-learn @@ -76,5 +76,15 @@ foreach my $recipient (keys %dests) { if (!run([qw(spamc -L), $train], \$in, @output)) { $err = 1; } + + $err or eval { + require PublicInbox::Search; + require PublicInbox::GitCatFile; + my $git = PublicInbox::GitCatFile->new($git_dir); + umask 0022; # XXX FIXME use git config core.sharedRepository + my $s = PublicInbox::Search->new($git_dir, 1); + $s->index_sync($git); + }; } + exit $err; -- cgit v1.2.3-24-ge0c7