Sha256: c5855a2f717a106489e92d1b579e5791395268b1b78fba53f23eb8baaa247d3d
Contents?: true
Size: 679 Bytes
Versions: 117
Compression:
Stored size: 679 Bytes
Contents
# Make sure no jobs are enqueued from a rolled back # transaction. Pageflow mainly triggers jobs in conjunction with state # machine transitions. So this patch ensures state db state and # enqueued jobs stay in sync. # # Note the after_transaction yields immediately if there is no open # transcation. require 'ar_after_transaction' require 'resque' Resque.class_eval do class << self alias_method :enqueue_without_transaction, :enqueue def enqueue(*args) if Resque.inline? enqueue_without_transaction(*args) else ActiveRecord::Base.after_transaction do enqueue_without_transaction(*args) end end end end end
Version data entries
117 entries across 115 versions & 2 rubygems