1

ループを使用して複数のアクティブなジョブを渡す予定です。しかし、各データループに遅延/タイムアウト機能が必要です。私のコードは次のようなものです:

for s in @saved_jobs
  # ADD delay funtion for each data to pass in ActiveJob Process
  # for ex. every data will pass to background job after every 3minutes
  ActiveCallsJob.perform_later(xxx, xx, x)
end

@saved_jobs = Information from DB
ActiveCallsJob = Class name of ActiveJob

助けてくださいありがとう!

4

1 に答える 1

0

シンプルです。マニュアルを読むだけです: http://guides.rubyonrails.org/active_job_basics.html#enqueue-the-job

# Enqueue a job to be performed tomorrow at noon.
MyJob.set(wait_until: Date.tomorrow.noon).perform_later(record)

# Enqueue a job to be performed 1 week from now.
MyJob.set(wait: 1.week).perform_later(record)
于 2015-08-20T21:09:06.200 に答える