What's the best way to organize worker processes in Rails?

前端 未结 4 1701
无人及你
无人及你 2020-12-23 17:49

I frequently have some code that should be run either on a schedule or as a background process with some parameters. The common element is that they are run outside the disp

4条回答
  •  一整个雨季
    2020-12-23 18:25

    For regularly scheduled tasks, I just use rake tasks. It's simple, easily tested, easily understood and integrates well with the Rails environment. Then just execute these rake tasks with a cron job at whatever interval you require (I use whenever to manage these jobs because I'm slightly cron-illiterate).

提交回复
热议问题