【问题标题】:How to run a command once after a certain time (RoR)?如何在一定时间后运行一次命令(RoR)?
【发布时间】:2012-12-07 22:57:42
【问题描述】:

我想在设置一些标志后 48 小时运行命令。例如,列得到更新,48 小时后命令被执行。我知道我可以使用 'whenever' gem 并安排每小时(每天等)检查,但是如果我只想运行 1 个命令一次呢?

【问题讨论】:

    标签: ruby-on-rails cron whenever


    【解决方案1】:

    Delayed Job 及其 run_at 选项非常适用于此。

    Zada's Notes: Rails Tips: Using delayed_job to schedule jobs at specific times

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2010-10-10
      • 2017-10-29
      • 2021-05-25
      • 1970-01-01
      • 2013-04-12
      • 2016-07-24
      • 2018-07-28
      相关资源
      最近更新 更多