unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
* [PATCH] extindex: use nproc_shards directly from IPC
@ 2025-01-02 22:50 Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2025-01-02 22:50 UTC (permalink / raw)
  To: meta

There's no reason to use it from the V2Writable namespace
since it was moved to PublicInbox::IPC in commit
9225145d (ipc: move nproc_shards from v2writable, 2023-03-21)
Import it early via `use' so we can take advantage of prototype
checking while we're at it.
---
 lib/PublicInbox/ExtSearchIdx.pm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/PublicInbox/ExtSearchIdx.pm b/lib/PublicInbox/ExtSearchIdx.pm
index 4a479978..970d5eb3 100644
--- a/lib/PublicInbox/ExtSearchIdx.pm
+++ b/lib/PublicInbox/ExtSearchIdx.pm
@@ -28,6 +28,7 @@ use PublicInbox::Spawn ();
 use PublicInbox::Search;
 use PublicInbox::SearchIdx qw(prepare_stack is_ancestor is_bad_blob
 	update_checkpoint);
+use PublicInbox::IPC qw(nproc_shards);
 use PublicInbox::OverIdx;
 use PublicInbox::MiscIdx;
 use PublicInbox::MID qw(mids);
@@ -61,7 +62,7 @@ sub new {
 		lock_path => "$dir/ei.lock",
 	}, __PACKAGE__;
 	$self->{shards} = $self->count_shards ||
-		nproc_shards({ nproc => $opt->{jobs} });
+		nproc_shards { nproc => $opt->{jobs} };
 	my $oidx = PublicInbox::OverIdx->new("$self->{xpfx}/over.sqlite3");
 	$self->{-no_fsync} = $oidx->{-no_fsync} = 1 if !$opt->{fsync};
 	$self->{-dangerous} = 1 if $opt->{dangerous};
@@ -1401,7 +1402,6 @@ sub eidx_watch { # public-inbox-extindex --watch main loop
 no warnings 'once';
 *done = \&PublicInbox::V2Writable::done;
 *parallel_init = \&PublicInbox::V2Writable::parallel_init;
-*nproc_shards = \&PublicInbox::V2Writable::nproc_shards;
 *sync_prepare = \&PublicInbox::V2Writable::sync_prepare;
 *index_todo = \&PublicInbox::V2Writable::index_todo;
 *count_shards = \&PublicInbox::V2Writable::count_shards;

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2025-01-02 22:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-02 22:50 [PATCH] extindex: use nproc_shards directly from IPC Eric Wong

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).