Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed jobs not executing in Rails3.1rc5 due to run_at = nil #46

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/delayed/job.rb
Expand Up @@ -30,6 +30,8 @@ class Job < ActiveRecord::Base
cattr_accessor :min_priority, :max_priority
self.min_priority = nil
self.max_priority = nil

before_save :update_run_at

# When a worker is exiting, make sure we don't have any locked jobs.
def self.clear_locks!
Expand Down Expand Up @@ -254,7 +256,7 @@ def self.db_time_now

protected

def before_save
def update_run_at
self.run_at ||= self.class.db_time_now
end

Expand Down