Skip to content

Commit

Permalink
Replace remaining references to Time.now with Time.zone.now
Browse files Browse the repository at this point in the history
  • Loading branch information
bkeepers committed Oct 14, 2009
1 parent 2ed7dc5 commit cbb8bb0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.textile
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ The library evolves around a delayed_jobs table which looks as follows:
table.integer :attempts, :default => 0 # Provides for retries, but still fail eventually.
table.text :handler # YAML-encoded string of the object that will do work
table.text :last_error # reason for last failure (See Note below)
table.datetime :run_at # When to run. Could be Time.now for immediately, or sometime in the future.
table.datetime :run_at # When to run. Could be Time.zone.now for immediately, or sometime in the future.
table.datetime :locked_at # Set when a client is working on this object
table.datetime :failed_at # Set when all retries have failed (actually, by default, the record is deleted instead)
table.string :locked_by # Who is working on this object (if locked)
Expand Down
2 changes: 1 addition & 1 deletion generators/delayed_job/templates/migration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ def self.up
table.integer :attempts, :default => 0 # Provides for retries, but still fail eventually.
table.text :handler # YAML-encoded string of the object that will do work
table.text :last_error # reason for last failure (See Note below)
table.datetime :run_at # When to run. Could be Time.now for immediately, or sometime in the future.
table.datetime :run_at # When to run. Could be Time.zone.now for immediately, or sometime in the future.
table.datetime :locked_at # Set when a client is working on this object
table.datetime :failed_at # Set when all retries have failed (actually, by default, the record is deleted instead)
table.string :locked_by # Who is working on this object (if locked)
Expand Down
2 changes: 1 addition & 1 deletion spec/job_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ def perform; @@runs += 1; end
end

it "should not allow a second worker to get exclusive access if failed to be processed by worker1 and run_at time is now in future (due to backing off behaviour)" do
@job.update_attributes(:attempts => 1, :run_at => Time.now + 1.day)
@job.update_attributes(:attempts => 1, :run_at => 1.day.from_now)
@job_copy_for_worker_2.lock_exclusively!(4.hours, 'worker2').should == false
end
end
Expand Down

0 comments on commit cbb8bb0

Please sign in to comment.