docbrown/docs/backend/scheduled-jobs.md
Andy Zhao 955bdcb2bc
Update docs with Forem instead of dev.to (#9316)
* Rename all GitHub links from thepracticaldev/dev.to to forem/forem

* Use new site name

* Rename to Forem

* Rename more dev.to to forem

* Remove unnecessary redirects

* Rename DEV to Forem

* Use Forem instead of DEV for branding

* Use Forem instead of DEV for licensing

* Use seedling instead of DEV logo
2020-07-15 13:29:11 -04:00

943 B

title
Scheduled Jobs

Scheduled Jobs

As in the Technical Overview, We use Heroku Scheduler for scheduled jobs. As the name suggests, this is for regularly recurring tasks that need to be run every day, week, month, year, decade, and century.

Tasks are implemented in forem/lib/tasks/fetch.rake, typically in the form of:

task some_unique_task_name:, [optional_arg] => :environment do |optional_arg|
  ... do your thing here ...
end

You can explore the official Heroku documentation for defining tasks and read through tasks we have implemented for busting cache, awarding badges, and more.

In your Pull Request, communicate with a Forem Core Team Member to discuss at what frequency and ensure your task is scheduled on Heroku once your code is reviewed, approved, and merged.