You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: concurrency.rb
    path of file: ./repos/good_job/lib/good_job/active_job_extensions
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

module GoodJob
  module ActiveJobExtensions
    module Concurrency
      extend ActiveSupport::Concern

      VALID_TYPES = [String, Symbol, Numeric, Date, Time, TrueClass, FalseClass, NilClass].freeze

      class ConcurrencyExceededError < StandardError
        def backtrace
          [] # suppress backtrace
        end
      end

      module Prepends
        def deserialize(job_data)
          super
          self.good_job_concurrency_key = job_data['good_job_concurrency_key']
        end
      end

      included do
        prepend Prepends

 
    
      def good_job_enqueue_concurrency_check(job, on_abort:, on_enqueue:)
        # Don't attempt to enforce concurrency limits with other queue adapters.
        return on_enqueue&.call unless job.class.queue_adapter.is_a?(GoodJob::Adapter)

        # Always allow jobs to be retried because the current job's execution will complete momentarily
        return on_enqueue&.call if CurrentThread.active_job_id == job.job_id

        # Only generate the concurrency key on the initial enqueue in case it is dynamic
        job.good_job_concurrency_key ||= job._good_job_concurrency_key
        key = job.good_job_concurrency_key
        return on_enqueue&.call if key.blank?

        enqueue_limit = job.class.good_job_concurrency_config[:enqueue_limit]
        enqueue_limit = instance_exec(&enqueue_limit) if enqueue_limit.respond_to?(:call)
        enqueue_limit = nil unless enqueue_limit.present? && (0...Float::INFINITY).cover?(enqueue_limit)

        unless enqueue_limit
          total_limit = job.class.good_job_concurrency_config[:total_limit]
          total_limit = instance_exec(&total_limit) if total_limit.respond_to?(:call)
          total_limit = nil unless total_limit.present? && (0...Float::INFINITY).cover?(total_limit)
        end