lib/belated/queue.rb in belated-0.6.7 vs lib/belated/queue.rb in belated-0.7.0
- old
+ new
@@ -23,11 +23,11 @@
self.future_jobs = future_jobs
end
def push(job)
if job.is_a?(Symbol) || job.at.nil? ||
- job.at <= Time.now.utc
+ job.at <= Time.now.to_f
@queue.push(job)
else
@mutex.synchronize do
@future_jobs << job
end
@@ -55,10 +55,10 @@
log "reloading... if file exists #{File.exist?(FILE_NAME)}"
return unless File.exist?(FILE_NAME)
jobs = YAML.load(File.binread(FILE_NAME))
jobs.each do |job|
- if job.at && job.at > Time.now.utc
+ if job.at && job.at > Time.now.to_f
future_jobs.push(job)
else
@queue.push(job)
end
end