aboutsummaryrefslogtreecommitdiffstats
path: root/activejob/lib
diff options
context:
space:
mode:
Diffstat (limited to 'activejob/lib')
-rw-r--r--activejob/lib/active_job/queue_adapters/resque_adapter.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/activejob/lib/active_job/queue_adapters/resque_adapter.rb b/activejob/lib/active_job/queue_adapters/resque_adapter.rb
index 30a51485bd..384aa0c4cc 100644
--- a/activejob/lib/active_job/queue_adapters/resque_adapter.rb
+++ b/activejob/lib/active_job/queue_adapters/resque_adapter.rb
@@ -7,9 +7,8 @@ begin
rescue LoadError
begin
require 'resque_scheduler'
- rescue LoadError => e
- $stderr.puts 'The ActiveJob resque adapter requires resque-scheduler. Please add it to your Gemfile and run bundle install'
- raise e
+ rescue LoadError
+ false
end
end
@@ -22,6 +21,10 @@ module ActiveJob
end
def enqueue_at(job, timestamp, *args)
+ unless Resque.respond_to?(:enqueue_at_with_queue)
+ raise NotImplementedError, "To be able to schedule jobs with Resque you need the " \
+ "resque-scheduler gem. Please add it to your Gemfile and run bundle install"
+ end
Resque.enqueue_at_with_queue job.queue_name, timestamp, JobWrapper, job.name, *args
end
end