Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: grays/delayed_job
...
head fork: grays/delayed_job
  • 2 commits
  • 3 files changed
  • 0 commit comments
  • 2 contributors
View
2  lib/delayed/backend/base.rb
@@ -61,7 +61,7 @@ def work_off(num = 100)
end
def failed?
- failed_at
+ !!failed_at
end
alias_method :failed, :failed?
View
10 lib/delayed/backend/shared_spec.rb
@@ -459,7 +459,7 @@ def create_job(opts = {})
job = described_class.create! :handler => "--- !ruby/object:JobThatDoesNotExist {}"
worker.work_off
job.reload
- job.failed_at.should_not be_nil
+ job.should be_failed
end
end
end
@@ -480,7 +480,7 @@ def create_job(opts = {})
@job.reload
@job.last_error.should =~ /did not work/
@job.attempts.should == 1
- @job.failed_at.should_not be_nil
+ @job.should be_failed
end
it "should re-schedule jobs after failing" do
@@ -580,14 +580,14 @@ def create_job(opts = {})
it_should_behave_like "any failure more than Worker.max_attempts times"
it "should be failed if it failed more than Worker.max_attempts times" do
- @job.reload.failed_at.should == nil
+ @job.reload.should_not be_failed
Delayed::Worker.max_attempts.times { worker.reschedule(@job) }
- @job.reload.failed_at.should_not == nil
+ @job.reload.should be_failed
end
it "should not be failed if it failed fewer than Worker.max_attempts times" do
(Delayed::Worker.max_attempts - 1).times { worker.reschedule(@job) }
- @job.reload.failed_at.should == nil
+ @job.reload.should_not be_failed
end
end
end
View
2  spec/delayed/backend/test.rb
@@ -58,7 +58,7 @@ def self.find_available(worker_name, limit = 5, max_run_time = Worker.max_run_ti
jobs = all.select do |j|
j.run_at <= db_time_now &&
(j.locked_at.nil? || j.locked_at < db_time_now - max_run_time || j.locked_by == worker_name) &&
- j.failed_at.nil?
+ !j.failed?
end
jobs = jobs.select{|j| Worker.queues.include?(j.queue)} if Worker.queues.any?

No commit comments for this range

Something went wrong with that request. Please try again.