Reputation: 1682
I'm looking at some code and I see the equivalent of
SomeJob.perform_after_commit(foo, bar, baz)
and
class SomeJob < ActiveJob::Base
def perform(foo, bar, baz)
# does the thing
end
end
My understanding of the after_commit
callback is that it is relevant for ActiveRecord
s in order to run some callback after a transaction commits.
What does it mean for an ActiveJob
? Does it default to executing immediately in the background - a "trivial transaction commit", if you will?
Upvotes: 1
Views: 317
Reputation: 859
you can use the gem ar_after_transaction, to execute code after all database transactions are closed.
Upvotes: 1