diff --git a/app/jobs/attempt_project_repo_mapping_job.rb b/app/jobs/attempt_project_repo_mapping_job.rb index 2510134..a51e3eb 100644 --- a/app/jobs/attempt_project_repo_mapping_job.rb +++ b/app/jobs/attempt_project_repo_mapping_job.rb @@ -1,7 +1,6 @@ class AttemptProjectRepoMappingJob < ApplicationJob queue_as :latency_10s - - include GoodJob::ActiveJobExtensions::Concurrency + include HasEnqueueControl good_job_control_concurrency_with( total_limit: 1, diff --git a/app/jobs/concerns/has_enqueue_control.rb b/app/jobs/concerns/has_enqueue_control.rb index 62307dc..31cae11 100644 --- a/app/jobs/concerns/has_enqueue_control.rb +++ b/app/jobs/concerns/has_enqueue_control.rb @@ -11,4 +11,12 @@ module HasEnqueueControl ) end end + + def perform(*args) + super + rescue GoodJob::ActiveJobExtensions::Concurrency::ConcurrencyExceededError + msg = "Concurrency limit exceeded for #{self.class.name}" + msg += " with args: #{args.inspect}" if args.present? + Rails.logger.info msg + end end