]> Sergey Matveev's repositories - public-inbox.git/commitdiff
lei_store: give process a better name
authorEric Wong <e@80x24.org>
Wed, 24 Mar 2021 09:23:32 +0000 (14:23 +0500)
committerEric Wong <e@80x24.org>
Wed, 24 Mar 2021 23:01:19 +0000 (23:01 +0000)
We'll prioritize the last two components of the path name
("lei/store") since that's how I often refer to the on-disk
location.  Then, show the XDG_DATA_HOME it belongs to in case
a user changes HOME or XDG_* for testing purposes.

lib/PublicInbox/LeiStore.pm

index fa03f93c93aa3a8895c478c055e1676c21263442..1311ad46ac0fe53ee73ecfb7950eaec03a3d4af9 100644 (file)
@@ -329,11 +329,13 @@ sub ipc_atfork_child {
 sub write_prepare {
        my ($self, $lei) = @_;
        unless ($self->{-ipc_req}) {
-               $self->ipc_lock_init($lei->store_path . '/ipc.lock');
+               my $d = $lei->store_path;
+               $self->ipc_lock_init("$d/ipc.lock");
+               substr($d, -length('/lei/store'), 10, '');
                # Mail we import into lei are private, so headers filtered out
                # by -mda for public mail are not appropriate
                local @PublicInbox::MDA::BAD_HEADERS = ();
-               $self->ipc_worker_spawn('lei_store', $lei->oldset,
+               $self->ipc_worker_spawn("lei/store $d", $lei->oldset,
                                        { lei => $lei });
        }
        $lei->{sto} = $self;