chore: Temporarily disable the disconnect logic for inboxes (#9321)

* chore: Temporarily disable the disconnect logic for inboxes

* Remove unused spec
This commit is contained in:
Pranav
2024-05-09 19:01:49 -07:00
committed by Pranav
parent 25c6adbd07
commit cbdc5b1ab0
2 changed files with 1 additions and 12 deletions
+1 -2
View File
@@ -12,8 +12,7 @@ class Inboxes::FetchImapEmailsJob < MutexApplicationJob
process_email_for_channel(channel)
end
rescue *ExceptionList::IMAP_EXCEPTIONS => e
Rails.logger.error e
channel.authorization_error!
Rails.logger.error "Authorization error for email channel - #{channel.inbox.id} : #{e.message}"
rescue EOFError, OpenSSL::SSL::SSLError, Net::IMAP::NoResponseError, Net::IMAP::BadResponseError, Net::IMAP::InvalidResponseError => e
Rails.logger.error e
rescue LockAcquisitionError
@@ -60,16 +60,6 @@ RSpec.describe Inboxes::FetchImapEmailsJob do
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).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 }