delayed_job

Public
Recipe for installing and setting up delayed_job in your application
Icons/chart bar
Used 3 times
Created by
P Prathamesh Sonpatki

Usage

Run this command in your Rails app directory in the terminal:

rails app:template LOCATION="https://railsbytes.com/script/VqqswW"
Template Source

Review the code before running this template on your machine.

gem 'delayed_job_active_record'
run "bundle install"
run "rails generate delayed_job:active_record"
rails_command "db:migrate"


initializer 'delayed_job_config.rb', <<-CODE
  Delayed::Worker.destroy_failed_jobs = false
  Delayed::Worker.sleep_delay = 10
  Delayed::Worker.max_attempts = 3
  Delayed::Worker.max_run_time = 5.minutes
  Delayed::Worker.read_ahead = 20
  Delayed::Worker.default_queue_name = 'default'
  Delayed::Worker.raise_signal_exceptions = :term
CODE
Comments

Sign up or Login to leave a comment.

© 2023 GoRails, LLC