Skip to content

Commit 3f8774b

Browse files
committed
Delayed::Job
Running only in development or production Signed-off-by: Rodrigo Nardi <rnardi@netdef.org>
1 parent 469b503 commit 3f8774b

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

config/delayed_job.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ class << self
3434
Delayed::Worker.max_attempts = 5
3535
Delayed::Worker.max_run_time = 5.minutes
3636

37-
Delayed::Job.delete_all
37+
Delayed::Job.delete_all if ENV.fetch('RAILS_ENV', nil) == 'test'
38+
39+
# Load the database configuration
3840

3941
config = YAML.load_file('config/database.yml')[ENV.fetch('RACK_ENV', 'development')]
4042
ActiveRecord::Base.establish_connection(config)

0 commit comments

Comments
 (0)