diff options
author | Eric Wong <e@yhbt.net> | 2020-06-27 10:03:49 +0000 |
---|---|---|
committer | Eric Wong <e@yhbt.net> | 2020-06-28 22:27:25 +0000 |
commit | 5f03b6c95af21dc2d499618ba03d63c44f70828c (patch) | |
tree | 8b1603844020da8701767ebc3e4b3fed93e3422c | |
parent | 9d4401395d5b08b5162e43b64fdb9b7169c10855 (diff) | |
download | public-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.
-rw-r--r-- | lib/PublicInbox/WatchMaildir.pm | 8 |
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 $@; + } } } |