Enhancement: Skip CTI log update when import_mode is active.

This commit is contained in:
Thorsten Eckel 2020-06-19 18:17:34 +02:00
parent da7cffd7bc
commit 6839d6e3e0
2 changed files with 10 additions and 0 deletions

View file

@ -345,6 +345,7 @@ return users by caller_id
end end
def update_cti_logs_with_fg_optimization def update_cti_logs_with_fg_optimization
return if Setting.get('import_mode')
return if object != 'User' return if object != 'User'
return if level != 'known' return if level != 'known'

View file

@ -300,6 +300,15 @@ RSpec.describe Cti::CallerId do
caller_id.save caller_id.save
end 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 end
describe 'on destruction' do describe 'on destruction' do