From 0e60e8878378f29f63e8d7e5ee0455e011ac3840 Mon Sep 17 00:00:00 2001 From: Mike Perham Date: Tue, 20 May 2014 09:37:38 -0700 Subject: More feedback --- lib/active_job/enqueuing.rb | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'lib/active_job/enqueuing.rb') diff --git a/lib/active_job/enqueuing.rb b/lib/active_job/enqueuing.rb index fb1e004a33..5ca901516c 100644 --- a/lib/active_job/enqueuing.rb +++ b/lib/active_job/enqueuing.rb @@ -2,7 +2,7 @@ require 'active_job/parameters' module ActiveJob module Enqueuing - # + # Push a job onto the queue. The arguments must be legal JSON types # (string, int, float, nil, true, false, hash or array) or # ActiveModel::GlobalIdentication instances. Arbitrary Ruby objects @@ -16,7 +16,6 @@ module ActiveJob queue_adapter.queue self, *serialized_args end - # # Enqueue a job to be performed at +interval+ from now. # # enqueue_in(1.week, "mike") @@ -26,16 +25,15 @@ module ActiveJob enqueue_at(interval.from_now, *args) end - # # Enqueue a job to be performed at an explicit point in time. # # enqueue_at(Date.tomorrow.midnight, "mike") # # Returns truthy if a job was scheduled. def enqueue_at(timestamp, *args) - ts = timestamp.to_f - ActiveSupport::Notifications.instrument "enqueue_at.active_job", adapter: queue_adapter, timestamp: ts, job: self, args: args - queue_adapter.queue_at self, ts, *Parameters.serialize(args) + timestamp = timestamp.to_f + ActiveSupport::Notifications.instrument "enqueue_at.active_job", adapter: queue_adapter, timestamp: timestamp, job: self, args: args + queue_adapter.queue_at self, timestamp, *Parameters.serialize(args) end end end -- cgit v1.2.3