From eaacb88fcb1428c84cd35575a177d2140a226ae2 Mon Sep 17 00:00:00 2001 From: Cristian Bica Date: Tue, 3 Jun 2014 01:04:08 +0300 Subject: [PATCH] Raise exception for scheduling jobs in the inline adapter --- lib/active_job/queue_adapters/inline_adapter.rb | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/lib/active_job/queue_adapters/inline_adapter.rb b/lib/active_job/queue_adapters/inline_adapter.rb index d116520285..50d14a321d 100644 --- a/lib/active_job/queue_adapters/inline_adapter.rb +++ b/lib/active_job/queue_adapters/inline_adapter.rb @@ -6,16 +6,8 @@ module ActiveJob job.new.execute *args end - def enqueue_at(job, timestamp, *args) - Thread.new do - begin - interval = Time.now.to_f - timestamp - sleep(interval) if interval > 0 - job.new.execute *args - rescue => e - ActiveJob::Base.logger.info "Error performing #{job}: #{e.message}" - end - end + def enqueue_at(*) + raise NotImplementedError.new("Use a queueing backend to enqueue jobs in the future. Read more at https://github.com/rails/activejob") end end end