开发者

Allowing a user to manually run a scheduled program from rails

开发者 https://www.devze.com 2023-03-27 22:35 出处:网络
As part of my web application I have a program that runs periodically during low activity times. However I want to allow the functionality to the user to be able to start the program manually. How can

As part of my web application I have a program that runs periodically during low activity times. However I want to allow the functionality to the user to be able to start the program manually. How can I do this? Where should I put my ruby program within the rails framework and how do I offer a link to commence the program then redirect to ano开发者_如何转开发ther page while the test is running. Thanks.


The code could be put in any controller but if you want the program to run quietly behind the scene without blocking your browser (pretty logic spec), you should trigger it using some tool like DelayedJob or Resque. Great Railscasts here.

0

精彩评论

暂无评论...
验证码 换一张
取 消