Delayed_job, demons, or another gem for repeating background jobs

I need to create a background task that goes through a list of RSS feeds and analyze them every 10 minutes.

I used delayed_job to handle background jobs, and I really liked it. I believe that it is not designed for repetitive background jobs. I guess I can automatically assign a background job to the end of each one (perhaps with begin..rescue to make sure it runs). Or ahead of time, tell me the month of advance payment that is behind the work, and you have another one that reschedules each month ..etc

This caused me some concern when I started asking myself: what if the server goes down in the middle of execution and there are no tasks scheduled?

I also looked at Daemons gems, which seemed like simple Ruby scripts with start / stop commands. I like the way delayed_job schedules and handles retries.

What do you recommend to use in this case? What do you think is the best way to create such a system with repeating background jobs? Also do you know the way I can control this background process and get notified if it stops?

+3
source share
3 answers

delayed_job ( :run_at => 2.days.from_now) , . - . , has_many delayed_job, :last_error. "" readme, .

+2

, : cron : ? - , railscasts .

cron + delayed_job, , .

+1

Take a look at SimpleWorker. This is a work queue for planning and processing the desktop. It is cloud-based and has constancy and redundancy, so you don’t have to worry about your servers dropping or restarting.

Very flexible in terms of planning, it provides a large introspection of tasks in the queue, as well as status and error notifications.

Full disclosure: I work in SimpleWorker.

0
source

All Articles