instance method perform_all_later

Ruby on Rails 8.1.2

Since v8.1.2

Signature

perform_all_later(*jobs)

Ensures perform_all_later respects each job’s enqueue_after_transaction_commit configuration. Jobs with enqueue_after_transaction_commit set to true are deferred and enqueued only after the transaction commits; other jobs are enqueued immediately. This ensures enqueuing timing matches the per-job setting.

Parameters

jobs rest
Source
# File activejob/lib/active_job/enqueue_after_transaction_commit.rb, line 15
      def perform_all_later(*jobs)
        jobs.flatten!
        deferred_jobs, immediate_jobs = jobs.partition { |job| job.class.enqueue_after_transaction_commit }
        super(immediate_jobs) if immediate_jobs.any?
        ActiveRecord.after_all_transactions_commit { super(deferred_jobs) } if deferred_jobs.any?
        nil
      end

Defined in activejob/lib/active_job/enqueue_after_transaction_commit.rb line 15 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveJob::EnqueueAfterTransactionCommit::ActiveJobMethods

Type at least 2 characters to search.

↑↓ navigate · open · esc close