diff options
author | Eric Wong <e@80x24.org> | 2020-10-13 01:34:30 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2020-10-13 07:15:14 +0000 |
commit | 8080720d242f7450ecaf7e962c0f4ac9c5c2115b (patch) | |
tree | 66e4c4dfdc9aa1fc8e6ed5f8f9fb4b43080b7570 | |
parent | 4c10137458c95adf45babd388c639c1344b62211 (diff) | |
download | public-inbox-8080720d242f7450ecaf7e962c0f4ac9c5c2115b.tar.gz |
When `--all' is passed to -index and similar commands, process them in the same order as what is given in the config file. This ensures predictable behavior so admins can ensure certain inboxes see updated indices before others. For (upcoming) external indices, this will ensure stable Xref: ordering for predictable caching/memoization by NNTP clients.
-rw-r--r-- | lib/PublicInbox/Admin.pm | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/PublicInbox/Admin.pm b/lib/PublicInbox/Admin.pm index fb88e621..9d48e5eb 100644 --- a/lib/PublicInbox/Admin.pm +++ b/lib/PublicInbox/Admin.pm @@ -97,12 +97,14 @@ sub resolve_inboxes ($;$$) { my $min_ver = $opt->{-min_inbox_version} || 0; my (@old, @ibxs); my %dir2ibx; + my $all = $opt->{all} ? [] : undef; if ($cfg) { $cfg->each_inbox(sub { my ($ibx) = @_; my $path = abs_path($ibx->{inboxdir}); if (defined($path)) { $dir2ibx{$path} = $ibx; + push @$all, $ibx if $all; } else { warn <<EOF; W: $ibx->{name} $ibx->{inboxdir}: $! @@ -110,10 +112,9 @@ EOF } }); } - if ($opt->{all}) { - my @all = values %dir2ibx; - @all = grep { $_->version >= $min_ver } @all; - push @ibxs, @all; + if ($all) { + @$all = grep { $_->version >= $min_ver } @$all; + @ibxs = @$all; } else { # directories specified on the command-line my $i = 0; my @dirs = @$argv; |