Sha256: d127a54e3c6f685d2d66973c2b759a31917d0ebf69219c70d290a071aef3beec
Contents?: true
Size: 1.08 KB
Versions: 62
Compression:
Stored size: 1.08 KB
Contents
module Cron # # Automatically update Product Version Lifecycle State to EOL If it is past it's EOL date # Runs Daily # class TrimFailedDelayedJobs < TrimCollection # # Return the failed collection # def collection Delayed::Backend::Mongoid::Job.where(:failed_at.exists => true) end def archive?(job) if 'Delayed::PerformableMethod'.eql?(job.name) data = { object: job.failed_object.inspect, method: job.failed_method_name, args: job.failed_args, failed_at: job.failed_at, attempts: job.attempts, locked_by: job.locked_by } SlackNotification.say(data, template: :failed_delayed_job) true else false end rescue StandardError => error log_error "Unable to determine if we should archive job: #{job}", error false end # # If the slack API is not present, don't delete jobs or we wont know about it. # def self.valid_environment? SystemConfiguration.slack_api_url.present? end end end
Version data entries
62 entries across 62 versions & 1 rubygems