Is Rails's “delayed_job” for cron task really?

后端 未结 6 1284
遥遥无期
遥遥无期 2021-02-04 12:29

delayed_job is at http://github.com/collectiveidea/delayed_job

Can delayed_job have the ability to do cron task? Such as running a script every night at 1am. Or run a

6条回答
  •  广开言路
    2021-02-04 13:19

    You can also use the ClockWork gem: https://github.com/adamwiggins/clockwork-rails-dj

    Clockwork runs as a separate daemon and can be used to trigger jobs of any sort that either getting added to a job queueing system or run right away.

    Use Delayed_Job for what it's good for, a job queueing system which can be distributed over multiple nodes (or not). Use something else to add jobs to the queue at the right time.

    I was using rake(or runner)/cron/whenever gem to schedule background tasks but was finding my server load was just so high because I would be getting hit constantly with rake/runner loading up the rails environment. Delayed_Job workers are your rails daemons that stay running so you aren't constantly firing up Rails every time a background task is required.

提交回复
热议问题