## Context Sidekiq logs only showed the Sidekiq wrapper class and JID, which wasn’t helpful when debugging ActiveJobs. ## Changes - Updated `ChatwootDequeuedLogger` to log the actual `ActiveJob class` and `job_id` instead of the generic Sidekiq wrapper and JID. > Example > ``` > Dequeued ActionMailer::MailDeliveryJob 123e4567-e89b-12d3-a456-426614174000 from default > ``` - Remove sidekiq worker and unify everything to `ActiveJob`
16 lines
648 B
Ruby
16 lines
648 B
Ruby
class ConversationReplyEmailJob < ApplicationJob
|
|
queue_as :mailers
|
|
|
|
def perform(conversation_id, last_queued_id)
|
|
conversation = Conversation.find(conversation_id)
|
|
|
|
if conversation.messages.incoming&.last&.content_type == 'incoming_email'
|
|
ConversationReplyMailer.with(account: conversation.account).reply_without_summary(conversation, last_queued_id).deliver_later
|
|
else
|
|
ConversationReplyMailer.with(account: conversation.account).reply_with_summary(conversation, last_queued_id).deliver_later
|
|
end
|
|
|
|
Redis::Alfred.delete(format(::Redis::Alfred::CONVERSATION_MAILER_KEY, conversation_id: conversation.id))
|
|
end
|
|
end
|