]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/LeiStore.pm
ipc: drop awaitpid_init to avoid circular refs
[public-inbox.git] / lib / PublicInbox / LeiStore.pm
index 0ecf138876e4faa4e88d5615790b77a6aa331ad5..fce15a724b511d15c49a3a2c196eb4d9e68291d7 100644 (file)
@@ -604,8 +604,8 @@ sub recv_and_run {
        $self->SUPER::recv_and_run(@args);
 }
 
-sub _sto_atexit { # awaitpid cb (via awaitpid_init)
-       my ($pid, $sto) = @_;
+sub _sto_atexit { # awaitpid cb
+       my ($pid) = @_;
        warn "lei/store PID:$pid died \$?=$?\n" if $?;
 }
 
@@ -620,12 +620,11 @@ sub write_prepare {
                # 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->awaitpid_init(\&_sto_atexit); # outlives $lei
                $self->wq_workers_start("lei/store $dir", 1, $lei->oldset, {
                                        lei => $lei,
                                        -err_wr => $w,
                                        to_close => [ $r ],
-                               });
+                               }, \&_sto_atexit);
                require PublicInbox::LeiStoreErr;
                PublicInbox::LeiStoreErr->new($r, $lei);
        }