chore: Move Whatsapp template sync to cron (#4858)

syncing WhatsApp templates job is moved to a cron job for a better user experience. The Templates are synced at 15-minute intervals now.
This commit is contained in:
Sojan Jose
2022-06-14 23:46:36 +05:30
committed by GitHub
parent 1bb0371c1d
commit fdcaed75f6
12 changed files with 88 additions and 9 deletions

View File

@@ -6,7 +6,7 @@ describe Whatsapp::IncomingMessageService do
stub_request(:post, 'https://waba.360dialog.io/v1/configs/webhook')
end
let!(:whatsapp_channel) { create(:channel_whatsapp) }
let!(:whatsapp_channel) { create(:channel_whatsapp, sync_templates: false) }
context 'when valid text message params' do
it 'creates appropriate conversations, message and contacts' do

View File

@@ -15,7 +15,7 @@ describe Whatsapp::SendOnWhatsappService do
context 'when a valid message' do
let(:whatsapp_request) { double }
let!(:whatsapp_channel) { create(:channel_whatsapp) }
let!(:whatsapp_channel) { create(:channel_whatsapp, sync_templates: false) }
let!(:contact_inbox) { create(:contact_inbox, inbox: whatsapp_channel.inbox, source_id: '123456789') }
let!(:conversation) { create(:conversation, contact_inbox: contact_inbox, inbox: whatsapp_channel.inbox) }