about summary refs log tree commit homepage
path: root/lib/PublicInbox/LeiExternal.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-03-20 19:04:03 +0900
committerEric Wong <e@80x24.org>2021-03-21 09:45:46 +0000
commit7d2e572aca7297ea2015d2b6e7c71b672521ec82 (patch)
tree072f2f81930af5a84091431171c8af43e0584011 /lib/PublicInbox/LeiExternal.pm
parent592daf02926f747bacaa85a1d1509374c7e66f11 (diff)
downloadpublic-inbox-7d2e572aca7297ea2015d2b6e7c71b672521ec82.tar.gz
This will be used for keyword (and label) storage for externals.
We'll be using this to ensure we don't redundantly auto-import
messages into lei/store if they're already in a local external
(they can still be imported explicitly via "lei import").
Diffstat (limited to 'lib/PublicInbox/LeiExternal.pm')
-rw-r--r--lib/PublicInbox/LeiExternal.pm6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/PublicInbox/LeiExternal.pm b/lib/PublicInbox/LeiExternal.pm
index b5dd85e1..aa09be9e 100644
--- a/lib/PublicInbox/LeiExternal.pm
+++ b/lib/PublicInbox/LeiExternal.pm
@@ -139,6 +139,12 @@ sub add_external_finish {
         my $key = "external.$location.boost";
         my $cur_boost = $cfg->{$key};
         return if defined($cur_boost) && $cur_boost == $new_boost; # idempotent
+        if (-d $location) {
+                require PublicInbox::LeiXSearch;
+                my $lxs = PublicInbox::LeiXSearch->new;
+                $lxs->prepare_external($location);
+                $self->ale->refresh_externals($lxs);
+        }
         $self->lei_config($key, $new_boost);
 }