Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我希望 rake 任务每天在东部时间上午 9 点进行一些快速的 API 调用。
我考虑过连接一个初始化器,它会一直等待到 9:01 或类似的时间,但这似乎很愚蠢。
我知道 heroku 有自己的内部调度程序,但有必要用于简单的 API 调用吗?
您将不得不使用某种调度程序来运行您的 rake 任务,无论是 cron 还是 heroku 调度程序。
Rake 只是一种专门的构建 DSL,它只是一种可以运行构建或其他任务的语言。它和其他程序一样是一个程序,因此只能在有人告诉它时运行。有人会是像 cron 这样的调度程序。