Skip to content

Commit

Permalink
chore: Temporarily disable the disconnect logic for inboxes (#9321)
Browse files Browse the repository at this point in the history
* chore: Temporarily disable the disconnect logic for inboxes

* Remove unused spec
  • Loading branch information
pranavrajs committed Apr 30, 2024
1 parent 0856d76 commit 2c3e7d6
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 11 deletions.
1 change: 0 additions & 1 deletion app/jobs/inboxes/fetch_imap_emails_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ def perform(channel, interval = 1)
end
rescue *ExceptionList::IMAP_EXCEPTIONS => e
Rails.logger.error "Authorization error for email channel - #{channel.inbox.id} : #{e.message}"
channel.authorization_error!
rescue EOFError, OpenSSL::SSL::SSLError, Net::IMAP::NoResponseError, Net::IMAP::BadResponseError, Net::IMAP::InvalidResponseError => e
Rails.logger.error "Error for email channel - #{channel.inbox.id} : #{e.message}"
rescue LockAcquisitionError
Expand Down
10 changes: 0 additions & 10 deletions spec/jobs/inboxes/fetch_imap_emails_job_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,6 @@
end
end

context 'when IMAP connection errors out' do
it 'mark the connection for authorization required' do
allow(Imap::FetchEmailService).to receive(:new).with(channel: imap_email_channel, interval: 1).and_raise(Errno::ECONNREFUSED)
allow(Redis::Alfred).to receive(:incr)

expect(Redis::Alfred).to receive(:incr).with("AUTHORIZATION_ERROR_COUNT:channel_email:#{imap_email_channel.id}")
described_class.perform_now(imap_email_channel)
end
end

context 'when the fetch service returns the email objects' do
let(:inbound_mail) { create_inbound_email_from_fixture('welcome.eml').mail }
let(:mailbox) { double }
Expand Down

0 comments on commit 2c3e7d6

Please sign in to comment.