Rails rails 里怎么实现像 Timer 一样的功能?

hlcfan · April 09, 2012 · Last by hlcfan replied at April 09, 2012 · 2650 hits

rails 里怎么实现像 Timer 一样的功能? 我现在想过一段时间就检测一个值是否存在。怎么做?

写成 Rake 任务,配合 cron 来定时执行 关于 cron 编写,可以尝试 whenever 这个 gem

同楼上,不过你要做什么任务还要看呢,有时做成 lazy 的也可以

You need to Sign in before reply, if you don't have an account, please Sign up first.