I have never worked on delayed jobs, trying first time.
I used whenever and delayed_job_active_record. for whenever I followed the instruction at whenever like
gem 'whenever', :require => false
command: wheneverize .
and added schedule.rb
every 2.minutes do
runner "Page.save_daily_detail" #Page is name of model, and save_daily_detail put some entries in database
end
than
whenever --update-crontab
For delayed_job_active_record
gem 'delayed_job_active_record'
commands:
rails generate delayed_job:active_record
rake db:migrate
also in application.rb
config.active_job.queue_adapter = :delayed_job
and when I start jobs with
bundle exec rake jobs:work
it says that jobs start but does nothing. what 'm I missing here?
You missed to restart crontab.
Only on linux answer works
Add this line in schedule.rb
While updating crontab pass environment variable accordingly in local and production.