diff options
author | Eric Wong <e@80x24.org> | 2023-11-22 01:04:18 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2023-11-22 22:16:34 +0000 |
commit | 19655cb200b8d0ecbd217d4c468bbba8d40ce014 (patch) | |
tree | 6031e9972be21d3e7ac95583b36994d8d3fb334b /lib/PublicInbox | |
parent | b64ce2044b0a9413855ad63ded4ddc9433e4ea9b (diff) | |
download | public-inbox-19655cb200b8d0ecbd217d4c468bbba8d40ce014.tar.gz |
For users hosting read-only mirrors (via clone|fetch) and feeding inboxes via -watch
Diffstat (limited to 'lib/PublicInbox')
-rw-r--r-- | lib/PublicInbox/Watch.pm | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/PublicInbox/Watch.pm b/lib/PublicInbox/Watch.pm index 5253ec94..b83a77eb 100644 --- a/lib/PublicInbox/Watch.pm +++ b/lib/PublicInbox/Watch.pm @@ -85,7 +85,10 @@ sub new { $watches = PublicInbox::Config::_array($watches); for my $watch (@$watches) { my $uri; - if (is_maildir($watch)) { + my $bool = $cfg->git_bool($watch); + if (defined $bool && !$bool) { + $ibx->{-watch_disabled} = 1; + } elsif (is_maildir($watch)) { compile_watchheaders($ibx); my ($new, $cur) = ("$watch/new", "$watch/cur"); my $cur_dst = $mdmap{$cur} //= []; @@ -143,6 +146,7 @@ sub _done_for_now { sub remove_eml_i { # each_inbox callback my ($ibx, $self, $eml, $loc) = @_; + return if $ibx->{-watch_disabled}; eval { # try to avoid taking a lock or unnecessary spawning |