about summary refs log tree commit homepage
path: root/lib/PublicInbox
diff options
context:
space:
mode:
authorEric Wong <e@yhbt.net>2020-06-27 10:03:49 +0000
committerEric Wong <e@yhbt.net>2020-06-28 22:27:25 +0000
commit5f03b6c95af21dc2d499618ba03d63c44f70828c (patch)
tree8b1603844020da8701767ebc3e4b3fed93e3422c /lib/PublicInbox
parent9d4401395d5b08b5162e43b64fdb9b7169c10855 (diff)
downloadpublic-inbox-5f03b6c95af21dc2d499618ba03d63c44f70828c.tar.gz
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.
Diffstat (limited to 'lib/PublicInbox')
-rw-r--r--lib/PublicInbox/WatchMaildir.pm8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/PublicInbox/WatchMaildir.pm b/lib/PublicInbox/WatchMaildir.pm
index 05aa6594..e4106490 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 $@;
+                }
         }
 }