about summary refs log tree commit homepage
path: root/lib/PublicInbox/FakeInotify.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/PublicInbox/FakeInotify.pm')
-rw-r--r--lib/PublicInbox/FakeInotify.pm10
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/PublicInbox/FakeInotify.pm b/lib/PublicInbox/FakeInotify.pm
index df63173f..debd2d39 100644
--- a/lib/PublicInbox/FakeInotify.pm
+++ b/lib/PublicInbox/FakeInotify.pm
@@ -16,16 +16,14 @@ my $poll_intvl = 2; # same as Filesys::Notify::Simple
 
 sub poll_once {
         my ($self) = @_;
-        sub {
-                eval { $self->poll };
-                warn "E: FakeInotify->poll: $@\n" if $@;
-                PublicInbox::DS::add_timer($poll_intvl, poll_once($self));
-        };
+        eval { $self->poll };
+        warn "E: FakeInotify->poll: $@\n" if $@;
+        PublicInbox::DS::add_timer($poll_intvl, \&poll_once, $self);
 }
 
 sub new {
         my $self = bless { watch => {} }, __PACKAGE__;
-        PublicInbox::DS::add_timer($poll_intvl, poll_once($self));
+        PublicInbox::DS::add_timer($poll_intvl, \&poll_once, $self);
         $self;
 }