use PublicInbox::NetReader;
use PublicInbox::Filter::Base qw(REJECT);
use PublicInbox::Spamcheck;
-use PublicInbox::Sigfd;
use PublicInbox::DS qw(now add_timer);
use PublicInbox::MID qw(mids);
use PublicInbox::ContentHash qw(content_hash);
};
require PublicInbox::DirIdle;
# inotify_create + EPOLL_CTL_ADD
- PublicInbox::DirIdle->new([keys %{$self->{mdmap}}], $cb);
+ my $dir_idle = PublicInbox::DirIdle->new($cb);
+ $dir_idle->add_watches([keys %{$self->{mdmap}}]);
}
sub net_cb { # NetReader::(nntp|imap)_each callback
my $end = now() + $intvl;
warn "I: $uri idling for ${intvl}s\n";
local $0 = "IDLE $0";
+ return if $self->{quit};
unless ($mic->idle) {
return if $self->{quit};
return "E: IDLE failed on $uri: $!";
delete $self->{poll_pids};
delete $self->{opendirs};
PublicInbox::DS->Reset;
- %SIG = (%SIG, %{$self->{sig}}, CHLD => 'DEFAULT');
+ my $sig = delete $self->{sig};
+ $sig->{CHLD} = 'DEFAULT';
+ @SIG{keys %$sig} = values %$sig;
PublicInbox::DS::sig_setmask($self->{oldset});
}
}
watch_fs_init($self) if $self->{mdre};
PublicInbox::DS->SetPostLoopCallback(sub { !$self->quit_done });
- PublicInbox::DS->EventLoop; # calls ->event_step
+ PublicInbox::DS::event_loop($sig, $oldset); # calls ->event_step
_done_for_now($self);
}