X-Git-Url: http://www.git.stargrave.org/?p=public-inbox.git;a=blobdiff_plain;f=lib%2FPublicInbox%2FDirIdle.pm;h=7031e5fd5615f17aa1df4467c6aebdcf36d7c31a;hp=5142d005e4aa326543fe8a99dca0c4e491eb42c5;hb=5b4fde37adefa37508d131dbe013353ef3345051;hpb=7e1c18af5468c7708e28de759911ec5542d23c4b diff --git a/lib/PublicInbox/DirIdle.pm b/lib/PublicInbox/DirIdle.pm index 5142d005..7031e5fd 100644 --- a/lib/PublicInbox/DirIdle.pm +++ b/lib/PublicInbox/DirIdle.pm @@ -53,6 +53,23 @@ sub new { $self; } +sub add_watches { + my ($self, $dirs, $gone) = @_; + my $fl = $MAIL_IN | ($gone ? $MAIL_GONE : 0); + for my $d (@$dirs) { + $self->{inot}->watch($d, $fl); + } + PublicInbox::FakeInotify::poll_once($self) if !$ino_cls; +} + +sub rm_watches { + my ($self, $dir) = @_; + my $inot = $self->{inot}; + if (my $cb = $inot->can('rm_watches')) { # TODO for fake watchers + $cb->($inot, $dir); + } +} + sub event_step { my ($self) = @_; my $cb = $self->{cb};