]> Sergey Matveev's repositories - public-inbox.git/commitdiff
search: lookup_mail handles modified DBs
authorEric Wong <e@80x24.org>
Thu, 22 Dec 2016 08:00:26 +0000 (08:00 +0000)
committerEric Wong <e@80x24.org>
Thu, 22 Dec 2016 08:13:57 +0000 (08:13 +0000)
We call lookup_mail all over the place, be sure we can handle
database modifications in those cases.

lib/PublicInbox/Search.pm

index d4f6f77a548f79acedfaf0b0de2a5b640dcaf017..b59430d8e9d7748c0ad49130d22acdeeebfafaca 100644 (file)
@@ -289,8 +289,10 @@ sub lookup_message {
 
 sub lookup_mail { # no ghosts!
        my ($self, $mid) = @_;
-       my $smsg = lookup_message($self, $mid) or return;
-       PublicInbox::SearchMsg->load_doc($smsg->{doc});
+       retry_reopen($self, sub {
+               my $smsg = lookup_message($self, $mid) or return;
+               PublicInbox::SearchMsg->load_doc($smsg->{doc});
+       });
 }
 
 sub find_unique_doc_id {