Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixing problem with no Time.zone

  • Loading branch information...
commit 19d4c50b3250171698a8f5f7561e7ba923ca5250 1 parent 4eaa2af
Andrew Timberlake andrewtimberlake authored
Showing with 3 additions and 44 deletions.
  1. +1 −1  VERSION
  2. +0 −41 delayed_job.gemspec
  3. +2 −2 lib/delayed/job.rb
2  VERSION
View
@@ -1 +1 @@
-1.8.5
+1.8.4.2
41 delayed_job.gemspec
View
@@ -1,41 +0,0 @@
-#version = File.read('README.textile').scan(/^\*\s+([\d\.]+)/).flatten
-
-Gem::Specification.new do |s|
- s.name = "delayed_job"
- s.version = "1.7.0"
- s.date = "2008-11-28"
- s.summary = "Database-backed asynchronous priority queue system -- Extracted from Shopify"
- s.email = "tobi@leetsoft.com"
- s.homepage = "http://github.com/tobi/delayed_job/tree/master"
- s.description = "Delated_job (or DJ) encapsulates the common pattern of asynchronously executing longer tasks in the background. It is a direct extraction from Shopify where the job table is responsible for a multitude of core tasks."
- s.authors = ["Tobias Lütke"]
-
- # s.bindir = "bin"
- # s.executables = ["delayed_job"]
- # s.default_executable = "delayed_job"
-
- s.has_rdoc = false
- s.rdoc_options = ["--main", "README.textile"]
- s.extra_rdoc_files = ["README.textile"]
-
- # run git ls-files to get an updated list
- s.files = %w[
- MIT-LICENSE
- README.textile
- delayed_job.gemspec
- init.rb
- lib/delayed/job.rb
- lib/delayed/message_sending.rb
- lib/delayed/performable_method.rb
- lib/delayed/worker.rb
- lib/delayed_job.rb
- tasks/jobs.rake
- tasks/tasks.rb
- ]
- s.test_files = %w[
- spec/database.rb
- spec/delayed_method_spec.rb
- spec/job_spec.rb
- spec/story_spec.rb
- ]
-end
4 lib/delayed/job.rb
View
@@ -110,7 +110,7 @@ def self.enqueue(*args, &block)
unless object.respond_to?(:perform) || block_given?
raise ArgumentError, 'Cannot enqueue items which do not respond to perform'
end
-
+
options = args.first || {}
options[:priority] ||= 0
options[:payload_object] = object
@@ -258,7 +258,7 @@ def attempt_to_load(klass)
# Note: This does not ping the DB to get the time, so all your clients
# must have syncronized clocks.
def self.db_time_now
- (ActiveRecord::Base.default_timezone == :utc) ? Time.now.utc : Time.zone.now
+ (ActiveRecord::Base.default_timezone == :utc) ? Time.now.utc : (Time.zone ? Time.zone.now : Time.now)
end
protected
Please sign in to comment.
Something went wrong with that request. Please try again.