From f2364c5765f0692d2f1e82b61804359a38f3fdfc Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 25 Dec 2019 07:51:04 +0000 Subject: search: retry_reopen passes user arg to callback This allows callers to pass named (not anonymous) subs. Update all retry_reopen callers to use this feature, and fix some places where we failed to use retry_reopen :x --- lib/PublicInbox/Mbox.pm | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'lib/PublicInbox/Mbox.pm') diff --git a/lib/PublicInbox/Mbox.pm b/lib/PublicInbox/Mbox.pm index 3fdda5ea..1f9ac6ec 100644 --- a/lib/PublicInbox/Mbox.pm +++ b/lib/PublicInbox/Mbox.pm @@ -12,6 +12,7 @@ use strict; use warnings; use PublicInbox::MID qw/mid_escape/; use PublicInbox::Hval qw/to_filename/; +use PublicInbox::SearchMsg; use Email::Simple; use Email::MIME::Encode; @@ -204,10 +205,8 @@ sub results_cb { my $srch = $ctx->{srch}; while (1) { while (my $mi = (($mset->items)[$ctx->{iter}++])) { - my $doc = $mi->get_document; - my $smsg = $srch->retry_reopen(sub { - PublicInbox::SearchMsg->load_doc($doc); - }) or next; + my $smsg = PublicInbox::SearchMsg::from_mitem($mi, + $srch) or next; return $smsg; } # refill result set -- cgit v1.2.3-24-ge0c7