Merge pull request #1889 from dsander/rename-scope

Rename Delayed::Job failed scope to prevent warning
This commit is contained in:
Dominik Sander 2017-01-31 11:19:38 +01:00 committed by GitHub
commit 77842eae64
2 changed files with 2 additions and 2 deletions

View file

@ -22,7 +22,7 @@ class WorkerStatusController < ApplicationController
render json: {
pending: Delayed::Job.pending.where("run_at <= ?", start).count,
awaiting_retry: Delayed::Job.awaiting_retry.count,
recent_failures: Delayed::Job.failed.where('failed_at > ?', 5.days.ago).count,
recent_failures: Delayed::Job.failed_jobs.where('failed_at > ?', 5.days.ago).count,
event_count: count,
max_id: max_id || 0,
events_url: events_url,

View file

@ -14,7 +14,7 @@ ActiveSupport.on_load(:delayed_job_active_record) do
class Delayed::Job
scope :pending, -> { where("locked_at IS NULL AND attempts = 0") }
scope :awaiting_retry, -> { where("failed_at IS NULL AND attempts > 0 AND locked_at IS NULL") }
scope :failed, -> { where("failed_at IS NOT NULL") }
scope :failed_jobs, -> { where("failed_at IS NOT NULL") }
end
database_deadlocks_when_using_optimized_strategy = lambda do