user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [PATCH 5/6] daemon: kill_workers: eliminate unnecessary loop
  2020-12-20  6:30  7% [PATCH 0/6] path usability and some tiny cleanups Eric Wong
@ 2020-12-20  6:30  7% ` Eric Wong
  0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2020-12-20  6:30 UTC (permalink / raw)
  To: meta

The `kill' perl op takes multiple PIDs, so there's no need to
iterate through the %pids hash.
---
 lib/PublicInbox/Daemon.pm | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/lib/PublicInbox/Daemon.pm b/lib/PublicInbox/Daemon.pm
index eeac3bd2..1762be0b 100644
--- a/lib/PublicInbox/Daemon.pm
+++ b/lib/PublicInbox/Daemon.pm
@@ -419,11 +419,8 @@ sub upgrade { # $_[0] = signal name or number (unused)
 }
 
 sub kill_workers ($) {
-	my ($s) = @_;
-
-	while (my ($pid, $id) = each %pids) {
-		kill $s, $pid;
-	}
+	my ($sig) = @_;
+	kill $sig, keys(%pids);
 }
 
 sub upgrade_aborted ($) {

^ permalink raw reply related	[relevance 7%]

* [PATCH 0/6] path usability and some tiny cleanups
@ 2020-12-20  6:30  7% Eric Wong
  2020-12-20  6:30  7% ` [PATCH 5/6] daemon: kill_workers: eliminate unnecessary loop Eric Wong
  0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2020-12-20  6:30 UTC (permalink / raw)
  To: meta

1/6 makes some (IMHO) important usability improvements to
existing commands.  The rest are some yak-shaving while
I attempt to speed up config handling with thousands of
inboxes...

Eric Wong (6):
  script/public-inbox-*: favor caller-provided pathnames
  inboxidle: remove needless check for {inboxdir}
  daemon: lazy load Cwd only for --daemonize users
  daemon: unconditionally call IO::Handle::blocking(0)
  daemon: kill_workers: eliminate unnecessary loop
  config: eliminate unnecessary join call up front

 lib/PublicInbox/Admin.pm     | 102 +++++++++++++++++++++++------------
 lib/PublicInbox/Config.pm    |  14 +++--
 lib/PublicInbox/Daemon.pm    |  17 +++---
 lib/PublicInbox/InboxIdle.pm |   7 +--
 script/public-inbox-convert  |  27 +++-------
 script/public-inbox-init     |  10 +---
 t/admin.t                    |  16 +++---
 7 files changed, 100 insertions(+), 93 deletions(-)

^ permalink raw reply	[relevance 7%]

Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2020-12-20  6:30  7% [PATCH 0/6] path usability and some tiny cleanups Eric Wong
2020-12-20  6:30  7% ` [PATCH 5/6] daemon: kill_workers: eliminate unnecessary loop Eric Wong

Code repositories for project(s) associated with this public inbox

	https://80x24.org/public-inbox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).