class Para::Job::Base
Protected Instance Methods
Source
# File lib/para/job/base.rb, line 35 def ensure_total_progress return if @_total_progress @_total_progress ||= if respond_to?(:total_progress, true) progress.total = total_progress else progress[:total] end end
Source
# File lib/para/job/base.rb, line 20 def progress! ensure_total_progress progress.increment end
Source
# File lib/para/job/base.rb, line 53 def rescue_exception(exception) status.update(status: :failed) tag_logger(self.class.name, job_id) do ActiveSupport::Notifications.instrument "failed.active_job", adapter: self.class.queue_adapter, job: self, exception: exception end if defined?(ExceptionNotifier) ExceptionNotifier.notify_exception( exception, data: { job: self.class.name, payload: arguments } ) end raise exception end
Source
# File lib/para/job/base.rb, line 25 def save_errors! status.update(errors: errors.full_messages) end
Source
# File lib/para/job/base.rb, line 45 def store(key, value = nil) if value status.update(key => value) else status[key] end end
Source
# File lib/para/job/base.rb, line 16 def store_job_type status.update(job_type: self.class.name) end
Source
# File lib/para/job/base.rb, line 31 def total_progress nil end
Default total progress to nil, making the UI show an animated porgress bar, indicating work is in progress, but not the exact progress