I know a hundred things about the Nth room, but I'll write it down so I don't forget it.
I didn't know that the whenever gem didn't work on heroku, so I just deployed it the next day, that? No data has been created. .. .. ?? ?? The tragedy happened with the service I made. : crying_cat_face:
Official documentation for heroku scheduler There is an addon called heroku scheduler. So use it.
Add addon and add task content to lib / tasks / scheduler.rb
lib/tasks/scheduler.rb
desc 'Write the purpose of the job'
task job name: :environment do
#processing
end
end
Select the expected execution cycle, enter rake job name
in job, and complete the setting.
For single execution,
heroku run rake task name
Recommended Posts