diff options
author | Eric Wong <e@80x24.org> | 2023-10-04 03:49:14 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2023-10-04 17:46:30 +0000 |
commit | 2f946a02bc324612febdfe31604b79e0196a215f (patch) | |
tree | a225827b35718f40cd0d6c50d584895e211a5ae1 /lib/PublicInbox/LEI.pm | |
parent | 1cbad18d329faad67c85f4d56f79afc80a2c80c4 (diff) | |
download | public-inbox-2f946a02bc324612febdfe31604b79e0196a215f.tar.gz |
It's shared by both by lei and public-facing daemons in using the ->busy callback.
Diffstat (limited to 'lib/PublicInbox/LEI.pm')
-rw-r--r-- | lib/PublicInbox/LEI.pm | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/lib/PublicInbox/LEI.pm b/lib/PublicInbox/LEI.pm index 368eee26..977a94c6 100644 --- a/lib/PublicInbox/LEI.pm +++ b/lib/PublicInbox/LEI.pm @@ -1367,16 +1367,8 @@ sub lazy_start { $quit->(); } return 1 if defined($path); - my $n = 0; - for my $s (values %$dmap) { - $s->can('busy') or next; - if ($s->busy) { - ++$n; - } else { - $s->close; - } - } - drop_all_stores() if !$n; # drop stores only if no clients + my $n = PublicInbox::DS::close_non_busy() or + drop_all_stores(); # drop stores only if no clients # returns true: continue, false: stop $n + scalar(keys(%$PublicInbox::DS::AWAIT_PIDS)); }); |