]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/LeiRemote.pm
lei <q|up>: wait on remote mboxrd imports synchronously
[public-inbox.git] / lib / PublicInbox / LeiRemote.pm
index 945d9990a535e7bb4a6c2b6d41ce40f99055b583..e7deecb8b7c3847f717349b3935f4f788b6b621a 100644 (file)
@@ -26,11 +26,12 @@ sub _each_mboxrd_eml { # callback for MboxReader->mboxrd
        my ($eml, $self) = @_;
        my $lei = $self->{lei};
        my $xoids = $lei->{ale}->xoids_for($eml, 1);
+       my $smsg = bless {}, 'PublicInbox::Smsg';
        if ($lei->{sto} && !$xoids) { # memoize locally
-               $lei->{sto}->ipc_do('add_eml', $eml);
+               my $res = $lei->{sto}->ipc_do('add_eml', $eml);
+               $smsg = $res if ref($res) eq ref($smsg);
        }
-       my $smsg = bless {}, 'PublicInbox::Smsg';
-       $smsg->{blob} = $xoids ? (keys(%$xoids))[0]
+       $smsg->{blob} //= $xoids ? (keys(%$xoids))[0]
                                : git_sha(1, $eml)->hexdigest;
        $smsg->populate($eml);
        $smsg->{mid} //= '(none)';