Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何使 DelayedJob 不推送数据库中的作业,而是在开发环境中同步执行它们?
从 DelayedJob 2.1.3 开始,您可以Delayed::Worker.delay_jobs = false在初始化程序中使用。
Delayed::Worker.delay_jobs = false
您还可以检查 ENV 变量设置,以便在开发中强制作业异步:
Delayed::Worker.delay_jobs = Rails.env.production? || ENV['DELAYEDJOB'].present?