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

后端 未结 6 1136
遥遥无期
遥遥无期 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:10

    Whenever works great.

    I also like rufus-scheduler

    /config/initializers/task_scheduler.rb
    

    Then in that file:

    scheduler = Rufus::Scheduler.start_new  
    
    scheduler.every("1m") do  
       DailyDigest.send_digest!  
    end 
    

    I originally found this posted here

    I've tried it and it works well.

    update

    Now that I look back at that link it's pretty much the only rails company that I would want to work for. They have made some many gems and add such much to the community. Not to mention they have a huge team!

提交回复
热议问题