diff --git a/app/models/cti/caller_id.rb b/app/models/cti/caller_id.rb index 83f32b58e..dfd7b65cb 100644 --- a/app/models/cti/caller_id.rb +++ b/app/models/cti/caller_id.rb @@ -345,6 +345,7 @@ return users by caller_id end def update_cti_logs_with_fg_optimization + return if Setting.get('import_mode') return if object != 'User' return if level != 'known' diff --git a/spec/models/cti/caller_id_spec.rb b/spec/models/cti/caller_id_spec.rb index 96b664571..6332b4e82 100644 --- a/spec/models/cti/caller_id_spec.rb +++ b/spec/models/cti/caller_id_spec.rb @@ -300,6 +300,15 @@ RSpec.describe Cti::CallerId do caller_id.save end + + it 'skips jobs on import_mode true' do + Setting.set('import_mode', true) + + expect(UpdateCtiLogsByCallerJob).not_to receive(:perform_now) + expect(UpdateCtiLogsByCallerJob).not_to receive(:perform_later) + + caller_id.save + end end describe 'on destruction' do