Updated

app/use_cases/accounts/apps/chatwoots/webhooks / process_webhook_job.rb

A
19 lines of codes
1 methods
2.2 complexity/method
2 churn
2.24 complexity
0 duplications
# frozen_string_literal: true class Accounts::Apps::Chatwoots::Webhooks::ProcessWebhookJob < ApplicationJob
  1. Accounts::Apps::Chatwoots::Webhooks::ProcessWebhookJob has no descriptive comment
include GoodJob::ActiveJobExtensions::Concurrency self.queue_adapter = :good_job good_job_control_concurrency_with( # Maximum number of jobs with the concurrency key to be # concurrently performed (excludes enqueued jobs) perform_limit: 1, key: -> { "#{self.class.name}-#{arguments.last}" } ) def perform(event, _token)
  1. Accounts::Apps::Chatwoots::Webhooks::ProcessWebhookJob#perform doesn't depend on instance state (maybe move it to another class?)
event_hash = JSON.parse(event) Accounts::Apps::Chatwoots::Webhooks::ProcessWebhook.call(event_hash) end end