Sha256: 0ad5a1ec431677ded76e94faec093eeb43451c33528a2df50419bf899b485b28
Contents?: true
Size: 996 Bytes
Versions: 2
Compression:
Stored size: 996 Bytes
Contents
# TODO: These (or a version of them) should be moved to +ActiveJob::Core+ # and related concerns when upstreamed. module ActiveJob::Executing extend ActiveSupport::Concern included do attr_accessor :raw_data, :position, :finished_at, :blocked_by, :blocked_until, :worker_id, :started_at attr_reader :serialized_arguments attr_writer :status thread_cattr_accessor :current_queue_adapter end class_methods do def queue_adapter ActiveJob::Base.current_queue_adapter || super end end def retry ActiveJob.jobs.failed.retry_job(self) end def discard jobs_relation_for_discarding.discard_job(self) end def status return @status if @status.present? failed? ? :failed : :pending end private def jobs_relation_for_discarding case status when :failed then ActiveJob.jobs.failed when :pending then ActiveJob.jobs.pending.where(queue_name: queue_name) else ActiveJob.jobs end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
mission_control-jobs-0.1.1 | lib/active_job/executing.rb |
mission_control-jobs-0.1.0 | lib/active_job/executing.rb |