Aaron Van Bokhoven

Recurring delayed_job with cron

Written by Aaron Van Bokhoven on October 27, 2010

Do you need a delayed_job job to happen at certain times or intervals?

This one is easy and I use it quite often - particularly to scrape data at certain times during the day, and generate nightly statistics and reports.

Why would I use delayed_job to handle recurring jobs over rake task? Every time a rake task is issued, a new rails instance is spawned which takes time and memory to start and run. If a delayed_job daemon is already running, using that will save both. In my opinion, running a rake task that uses the rails environment is usually very costly in production and should be avoided if possible.