Permalink
Browse files

Fix boogs, stub not implemented adapters

  • Loading branch information...
1 parent a88d9eb commit 2aa9024eede567ae4daa97df62e32f57265096bc @mperham mperham committed May 20, 2014
@@ -32,11 +32,12 @@ def enqueue_in(interval, *args)
#
# Returns truthy if a job was scheduled.
def enqueue_at(timestamp, *args)
- ActiveSupport::Notifications.instrument "enqueue_at.active_job", adapter: queue_adapter, timestamp: timestamp, job: self, params: args
- if Time.now.to_f > timestamp
- queue.adapter.queue self, *Parameters.serialize(args)
+ ts = timestamp.to_f
+ ActiveSupport::Notifications.instrument "enqueue_at.active_job", adapter: queue_adapter, timestamp: ts, job: self, params: args
+ if Time.now.to_f > ts
+ queue_adapter.queue self, *Parameters.serialize(args)
else
- queue_adapter.queue_at self, timestamp.to_f, *Parameters.serialize(args)
+ queue_adapter.queue_at self, ts, *Parameters.serialize(args)
end
end
end
@@ -14,7 +14,7 @@ def queue_at(job, ts, *args)
sleep(interval) if interval > 0
job.new.perform *Parameters.deserialize(args)
rescue => ex
- ActiveSupport::Notifications.instrument "error.perform.active_job", adapter: self, job: job, params: args, error: ex
+ ActiveSupport::Notifications.instrument "perform_error.active_job", adapter: self, job: job, params: args, error: ex
end
end
end
@@ -7,6 +7,10 @@ class << self
def queue(job, *args)
JobWrapper.enqueue job, *args, queue: job.queue_name
end
+
+ def queue_at(job, timestamp, *args)
+ raise NotImplementedError
+ end
end
class JobWrapper < Que::Job
@@ -7,6 +7,10 @@ class << self
def queue(job, *args)
JobWrapper.enqueue([job, *args])
end
+
+ def queue_at(job, timestamp, *args)
+ raise NotImplementedError
+ end
end
class JobWrapper

0 comments on commit 2aa9024

Please sign in to comment.