]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/LeiXSearch.pm
lei_xsearch: simplify lei/store import check
[public-inbox.git] / lib / PublicInbox / LeiXSearch.pm
index 29df07e0c8a82e3a97ad620eaa59d4dccb2ee4c2..41e798562d424b097ec611ef5f283f2251d9563b 100644 (file)
@@ -285,7 +285,7 @@ sub each_remote_eml { # callback for MboxReader->mboxrd
                my ($res, $kw) = $self->{import_sto}->wq_do('add_eml', $eml);
                if (ref($res) eq ref($smsg)) { # totally new message
                        $smsg = $res;
-                       $self->{-imported} = 1;
+                       $self->{-sto_imported} = 1;
                }
                $smsg->{kw} = $kw; # short-circuit xsmsg_vmd
        }
@@ -342,7 +342,7 @@ sub query_remote_mboxrd {
        local $SIG{TERM} = sub { exit(0) }; # for DESTROY (File::Temp, $reap)
        my $lei = $self->{lei};
        my $opt = $lei->{opt};
-       my $qstr = $lei->{mset_opt}->{qstr};
+       chomp(my $qstr = $lei->{mset_opt}->{qstr});
        $qstr =~ s/[ \n\t]+/ /sg; # make URLs less ugly
        my @qform = (x => 'm');
        push(@qform, t => 1) if $opt->{threads};
@@ -376,7 +376,7 @@ sub query_remote_mboxrd {
                $fh = IO::Uncompress::Gunzip->new($fh, MultiStream => 1);
                PublicInbox::MboxReader->mboxrd($fh, \&each_remote_eml, $self,
                                                $lei, $each_smsg);
-               if ($self->{import_sto} && delete($self->{-imported})) {
+               if (delete($self->{-sto_imported})) {
                        my $wait = $self->{import_sto}->wq_do('done');
                }
                $reap_curl->join;