* [PATCH 23/34] watch: imap: be quiet about disconnecting on quit
@ 2020-06-27 10:03 7% ` Eric Wong
0 siblings, 0 replies; 1+ results
From: Eric Wong @ 2020-06-27 10:03 UTC (permalink / raw)
To: meta
If ->idle_done was handled successfully, we can just
let normal ->DESTROY disconnect and avoid ugly backtraces
when a user hits Ctrl-C to take down the process group.
---
lib/PublicInbox/WatchMaildir.pm | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/lib/PublicInbox/WatchMaildir.pm b/lib/PublicInbox/WatchMaildir.pm
index 05aa6594147..e4106490c27 100644
--- a/lib/PublicInbox/WatchMaildir.pm
+++ b/lib/PublicInbox/WatchMaildir.pm
@@ -208,9 +208,11 @@ sub quit {
}
if (my $idle_mic = $self->{idle_mic}) {
eval { $idle_mic->done };
- warn "IDLE DONE error: $@\n" if $@;
- eval { $idle_mic->disconnect };
- warn "IDLE LOGOUT error: $@\n" if $@;
+ if ($@) {
+ warn "IDLE DONE error: $@\n";
+ eval { $idle_mic->disconnect };
+ warn "IDLE LOGOUT error: $@\n" if $@;
+ }
}
}
^ permalink raw reply related [relevance 7%]
Results 1-1 of 1 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2020-06-27 10:03 [PATCH 00/34] watch: add IMAP and NNTP support Eric Wong
2020-06-27 10:03 7% ` [PATCH 23/34] watch: imap: be quiet about disconnecting on quit Eric Wong
Code repositories for project(s) associated with this public inbox
https://80x24.org/public-inbox.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).