diff --git a/app/jobs/inboxes/fetch_imap_emails_job.rb b/app/jobs/inboxes/fetch_imap_emails_job.rb index e8a85b418..a00094bd1 100644 --- a/app/jobs/inboxes/fetch_imap_emails_job.rb +++ b/app/jobs/inboxes/fetch_imap_emails_job.rb @@ -13,7 +13,6 @@ class Inboxes::FetchImapEmailsJob < MutexApplicationJob 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 diff --git a/spec/jobs/inboxes/fetch_imap_emails_job_spec.rb b/spec/jobs/inboxes/fetch_imap_emails_job_spec.rb index 62816b99d..8b81de070 100644 --- a/spec/jobs/inboxes/fetch_imap_emails_job_spec.rb +++ b/spec/jobs/inboxes/fetch_imap_emails_job_spec.rb @@ -69,16 +69,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, 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 }