mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Raise exception for scheduling jobs in the inline adapter
This commit is contained in:
parent
8a3b137f95
commit
eaacb88fcb
1 changed files with 2 additions and 10 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue