From: Eric Wong Date: Thu, 21 Oct 2021 21:10:25 +0000 (+0000) Subject: watch: check for {quit} before IDLE X-Git-Tag: v1.7.0~89 X-Git-Url: http://www.git.stargrave.org/?p=public-inbox.git;a=commitdiff_plain;h=8c9e20805d1e2a9245ae35ed6c5b737731513be8 watch: check for {quit} before IDLE This may make it less likely for watch-dependent tests to get stuck. Unfortunately, due to the synchronous API of Mail::IMAPClient, ->idle is still susceptible to missing signals. --- diff --git a/lib/PublicInbox/Watch.pm b/lib/PublicInbox/Watch.pm index b48d9ccc..e80bbdec 100644 --- a/lib/PublicInbox/Watch.pm +++ b/lib/PublicInbox/Watch.pm @@ -330,6 +330,7 @@ sub imap_idle_once ($$$$) { my $end = now() + $intvl; warn "I: $uri idling for ${intvl}s\n"; local $0 = "IDLE $0"; + return if $self->{quit}; unless ($mic->idle) { return if $self->{quit}; return "E: IDLE failed on $uri: $!";