Hi Everyone, I hope you guys can help me out. What is the best way to go about using a timer to execute events? I would like to execute a block of code every 24 hours (or at midnight - server time). Is this possible? What I am trying to get at is that I would like to create a new page every 24 hours and have that serve as my front page. Is it possible to route to this ''new page''? Any insights on this on any of this would be great! Thank you in advance for your help!! -- Posted via http://www.ruby-forum.com/.
Jordan Isip wrote:> Hi Everyone, > > I hope you guys can help me out. What is the best way to go about using > a timer to execute events? I would like to execute a block of code > every 24 hours (or at midnight - server time). Is this possible? > > What I am trying to get at is that I would like to create a new page > every 24 hours and have that serve as my front page. Is it possible to > route to this ''new page''? Any insights on this on any of this would be > great! > > Thank you in advance for your help!!Hi Jordan, See if this helps :) http://wiki.rubyonrails.org/rails/pages/HowToRunBackgroundJobsInRails Victor -- Posted via http://www.ruby-forum.com/.
Hi Victor, Thanks for the link. Would you happen to know if this would work on my local webrick running windows? or do i need to deploy on a linux server? Thanks for your help. Jordan Victor Fan wrote:> Jordan Isip wrote: >> Hi Everyone, >> >> I hope you guys can help me out. What is the best way to go about using >> a timer to execute events? I would like to execute a block of code >> every 24 hours (or at midnight - server time). Is this possible? >> >> What I am trying to get at is that I would like to create a new page >> every 24 hours and have that serve as my front page. Is it possible to >> route to this ''new page''? Any insights on this on any of this would be >> great! >> >> Thank you in advance for your help!! > > Hi Jordan, > > See if this helps :) > http://wiki.rubyonrails.org/rails/pages/HowToRunBackgroundJobsInRails > > Victor-- Posted via http://www.ruby-forum.com/.
Jordan Isip wrote:> Hi Victor, > > Thanks for the link. Would you happen to know if this would work on my > local webrick running windows? or do i need to deploy on a linux server? > > Thanks for your help. > > Jordan > >The .script/runner -e production "Model.do_something" solution should work with any scheduler, I presume you can create a new task with the Windows XP scheduler and have .script/runner executed when needed BTW, .script/runner have nothing to do with webrick or any kind of http server - It is use to run Rails tasks outside the http server. -- Posted via http://www.ruby-forum.com/.