]> Sergey Matveev's repositories - public-inbox.git/commitdiff
watch: check for {quit} before IDLE
authorEric Wong <e@80x24.org>
Thu, 21 Oct 2021 21:10:25 +0000 (21:10 +0000)
committerEric Wong <e@80x24.org>
Fri, 22 Oct 2021 00:54:43 +0000 (00:54 +0000)
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.

lib/PublicInbox/Watch.pm

index b48d9cccc3e2b791958720aff4e06c187617149d..e80bbdec16fdf8dd766b8761d059caf48891e373 100644 (file)
@@ -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: $!";