From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 871AC1F92B for ; Sat, 27 Jun 2020 10:04:04 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 23/34] watch: imap: be quiet about disconnecting on quit Date: Sat, 27 Jun 2020 10:03:49 +0000 Message-Id: <20200627100400.9871-24-e@yhbt.net> In-Reply-To: <20200627100400.9871-1-e@yhbt.net> References: <20200627100400.9871-1-e@yhbt.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: 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 $@; + } } }