chore: Move Twilio event processing to background job (#11094)

- Twilio events were being processed synchronously, leading to slow API
responses.
- This change moves Twilio event processing to a background job to
improve performance and align with how other events (e.g., WhatsApp) are
handled.

---------

Co-authored-by: Pranav <pranav@chatwoot.com>
This commit is contained in:
Sojan Jose
2025-03-15 13:51:08 -07:00
committed by GitHub
parent 46ec92c86e
commit 586dc800bb
8 changed files with 108 additions and 20 deletions

View File

@@ -1,6 +1,6 @@
class Twilio::CallbackController < ApplicationController
def create
::Twilio::IncomingMessageService.new(params: permitted_params).perform
Webhooks::TwilioEventsJob.perform_later(permitted_params.to_unsafe_hash)
head :no_content
end

View File

@@ -1,6 +1,6 @@
class Twilio::DeliveryStatusController < ApplicationController
def create
::Twilio::DeliveryStatusService.new(params: permitted_params).perform
Webhooks::TwilioDeliveryStatusJob.perform_later(permitted_params.to_unsafe_hash)
head :no_content
end