Adrien Coquio
Adrien Coquio

Reputation: 4930

Make DelayedJob synchronous in development environment

How to make DelayedJob not pushing the job in the database but perform them synchronously on development environment ?

Upvotes: 1

Views: 334

Answers (1)

Adrien Coquio
Adrien Coquio

Reputation: 4930

As of DelayedJob 2.1.3 you can use Delayed::Worker.delay_jobs = false in an initializer.

You can also check for an ENV variable setting to make it possible to force jobs to be asynchronous in development :

Delayed::Worker.delay_jobs = Rails.env.production? || ENV['DELAYEDJOB'].present?

Upvotes: 3

Related Questions