]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/Inbox.pm
evcleanup: disable outside of daemon
[public-inbox.git] / lib / PublicInbox / Inbox.pm
index f000a950e48b2754a54fb8477ace9de34c106712..b9cd4c40a6dc7541f799f0da8b520e426af7df4d 100644 (file)
@@ -29,6 +29,7 @@ sub cleanup_task () {
 
 sub _cleanup_later ($) {
        my ($self) = @_;
+       return unless $PublicInbox::EvCleanup::ENABLED;
        $cleanup_timer ||= PublicInbox::EvCleanup::later(*cleanup_task);
        $CLEANUP->{"$self"} = $self;
 }
@@ -254,9 +255,11 @@ sub msg_by_mid ($$;$) {
        my ($self, $mid, $ref) = @_;
        my $srch = search($self) or
                        return msg_by_path($self, mid2path($mid), $ref);
-       my $smsg = $srch->lookup_skeleton($mid) or return;
-       $smsg->load_expand;
-       msg_by_smsg($self, $smsg, $ref);
+       my $smsg;
+       $srch->retry_reopen(sub {
+               $smsg = $srch->lookup_skeleton($mid) and $smsg->load_expand;
+       });
+       $smsg ? msg_by_smsg($self, $smsg, $ref) : undef;
 }
 
 1;