Skip to content

Commit dadd92d

Browse files
committed
improve imap idle loop
1 parent 1f17f0d commit dadd92d

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

app/services/imap/gmail_client.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ def idle_once(timeout: 1500)
129129
# the connection is torn down before the thread runs.
130130
idle_done_called = false
131131
@imap.idle(timeout) do |resp|
132+
next unless resp.is_a?(Net::IMAP::UntaggedResponse)
132133
got_activity = true
133134
yield resp if block_given?
134135
unless idle_done_called

0 commit comments

Comments
 (0)