From 7893b78fd691ef1e9b503e44174ff53278b02554 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 16 Oct 2021 01:00:58 +0000 Subject: lei: more eval guards for die on failure Relying on $lei->fail is unsustainable since there'll always be parts of our code and dependencies which can trigger die() and break the event loop. --- lib/PublicInbox/LeiXSearch.pm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'lib/PublicInbox/LeiXSearch.pm') diff --git a/lib/PublicInbox/LeiXSearch.pm b/lib/PublicInbox/LeiXSearch.pm index 4aa2a81c..8ab84b15 100644 --- a/lib/PublicInbox/LeiXSearch.pm +++ b/lib/PublicInbox/LeiXSearch.pm @@ -460,10 +460,11 @@ sub do_post_augment { my ($lei) = @_; local $PublicInbox::LEI::current_lei = $lei; my $l2m = $lei->{l2m} or return; # client disconnected - $lei->fchdir or return; - my $err; - eval { $l2m->post_augment($lei) }; - $err = $@; + eval { + $lei->fchdir; + $l2m->post_augment($lei); + }; + my $err = $@; if ($err) { if (my $lxs = delete $lei->{lxs}) { $lxs->wq_kill('-TERM'); -- cgit v1.2.3-24-ge0c7