about summary refs log tree commit homepage
path: root/lib/PublicInbox/LEI.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-10-16 01:00:53 +0000
committerEric Wong <e@80x24.org>2021-10-16 01:42:48 +0000
commitf64adbd5e3c35197c1915bca108cdcd81f74f708 (patch)
tree3e5d4e17d758ac0af766685508b84cad8660f438 /lib/PublicInbox/LEI.pm
parent879547527204b878b80804c2f19c6ef71458194e (diff)
downloadpublic-inbox-f64adbd5e3c35197c1915bca108cdcd81f74f708.tar.gz
dir_idle: do not add watches in ->new
There's no savings in having two ways to add watches to an
inotify nor kqueue descriptor.
Diffstat (limited to 'lib/PublicInbox/LEI.pm')
-rw-r--r--lib/PublicInbox/LEI.pm5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/PublicInbox/LEI.pm b/lib/PublicInbox/LEI.pm
index 7dfd3398..a526a91f 100644
--- a/lib/PublicInbox/LEI.pm
+++ b/lib/PublicInbox/LEI.pm
@@ -1305,10 +1305,11 @@ sub lazy_start {
                 USR2 => \&noop,
         };
         require PublicInbox::DirIdle;
-        local $dir_idle = PublicInbox::DirIdle->new([$sock_dir], sub {
+        local $dir_idle = PublicInbox::DirIdle->new(sub {
                 # just rely on wakeup to hit PostLoopCallback set below
                 dir_idle_handler($_[0]) if $_[0]->fullname ne $path;
-        }, 1);
+        });
+        $dir_idle->add_watches([$sock_dir]);
         PublicInbox::DS->SetPostLoopCallback(sub {
                 my ($dmap, undef) = @_;
                 if (@st = defined($path) ? stat($path) : ()) {