diff options
author | Eric Wong <e@80x24.org> | 2021-01-24 04:46:50 -0700 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2021-01-24 15:45:23 -0400 |
commit | d3a2b3c8df7ce2c2d62b532b814a3fdcc89f1cac (patch) | |
tree | 763cd4078886d8f896a95104afa2f56147e27894 /lib/PublicInbox/LeiQuery.pm | |
parent | c80fc47e280a500ff8d6c3fde53e7554272e749b (diff) | |
download | public-inbox-d3a2b3c8df7ce2c2d62b532b814a3fdcc89f1cac.tar.gz |
--remote should be explicitly enabled if local externals are present, since users may be offline or on expensive + metered Internet while traveling. In the future, --remote will probably default to caching/memoizing all messages it fetches to increase the usefulness of --local.
Diffstat (limited to 'lib/PublicInbox/LeiQuery.pm')
-rw-r--r-- | lib/PublicInbox/LeiQuery.pm | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/PublicInbox/LeiQuery.pm b/lib/PublicInbox/LeiQuery.pm index a7938e8b..7713902b 100644 --- a/lib/PublicInbox/LeiQuery.pm +++ b/lib/PublicInbox/LeiQuery.pm @@ -24,7 +24,9 @@ sub lei_q { # --external is enabled by default, but allow --no-external if ($opt->{external} //= 1) { my $cb = $lxs->can('prepare_external'); - $self->_externals_each($cb, $lxs); + my $ne = $self->_externals_each($cb, $lxs); + $opt->{remote} //= $ne == $lxs->remotes; + delete($lxs->{remotes}) if !$opt->{remote}; } my $xj = $lxs->concurrency($opt); my $ovv = PublicInbox::LeiOverview->new($self) or return; |