From ebc3f825c1eb95399c575fff816180a6e4fffeb6 Mon Sep 17 00:00:00 2001 From: "Eric Wong (Contractor, The Linux Foundation)" Date: Thu, 22 Feb 2018 21:17:53 +0000 Subject: v2/ui: retry DB reopens in a few more places Relying more on Xapian requires retrying reopens in more places to ensure it does not fall down and show errors to the user. --- lib/PublicInbox/Inbox.pm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'lib/PublicInbox/Inbox.pm') diff --git a/lib/PublicInbox/Inbox.pm b/lib/PublicInbox/Inbox.pm index f000a950..54a6eb32 100644 --- a/lib/PublicInbox/Inbox.pm +++ b/lib/PublicInbox/Inbox.pm @@ -254,9 +254,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; -- cgit v1.2.3-24-ge0c7