about summary refs log tree commit homepage
path: root/lib/PublicInbox/DirIdle.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-07-21 14:07:06 +0000
committerEric Wong <e@80x24.org>2021-07-22 02:29:01 +0000
commita1539672716f91acc67397a1a7d16e99df068931 (patch)
treed6390fd87fbc107523591a1840937b30c58c707d /lib/PublicInbox/DirIdle.pm
parent5b4fde37adefa37508d131dbe013353ef3345051 (diff)
downloadpublic-inbox-a1539672716f91acc67397a1a7d16e99df068931.tar.gz
This makes behavior less surprising on restarts as we no longer
lose state on restarts, so there's no need to manually run "lei
add-watch" to re-enable watches.  This also allows us to
transparently handle changes if somebody edits the lei config
file directly or via git-config(1).
Diffstat (limited to 'lib/PublicInbox/DirIdle.pm')
-rw-r--r--lib/PublicInbox/DirIdle.pm5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/PublicInbox/DirIdle.pm b/lib/PublicInbox/DirIdle.pm
index 7031e5fd..65896f95 100644
--- a/lib/PublicInbox/DirIdle.pm
+++ b/lib/PublicInbox/DirIdle.pm
@@ -56,10 +56,13 @@ sub new {
 sub add_watches {
         my ($self, $dirs, $gone) = @_;
         my $fl = $MAIL_IN | ($gone ? $MAIL_GONE : 0);
+        my @ret;
         for my $d (@$dirs) {
-                $self->{inot}->watch($d, $fl);
+                my $w = $self->{inot}->watch($d, $fl) or next;
+                push @ret, $w;
         }
         PublicInbox::FakeInotify::poll_once($self) if !$ino_cls;
+        @ret
 }
 
 sub rm_watches {