gama.franco-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2006-Sep-15 12:10 UTC
Periodic Task in Rails
Hi, Does the rails framework supports the execution of periodic tasks? Supose that I need to process RSS Feeds to update the database of the web application. Is this possible? Thanks, Gama Franco --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Your best bet will probably be backgroundrb http:// backgroundrb.rubyforge.org/ scott. On Sep 15, 2006, at 7:10 AM, gama.franco-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote:> > Hi, > > Does the rails framework supports the execution of periodic tasks? > > Supose that I need to process RSS Feeds to update the database of the > web application. Is this possible? > > Thanks, > Gama Franco > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
or call rails code by using the runner, like this: RAILS_ENV=development script/runner "p Product.find_all" Put it in a cronjob to run it till the end of times ;-) Gert On 9/15/06, Scott Walter <scott-APWf0AbNa2kIjDr1QQGPvw@public.gmane.org> wrote:> > > Your best bet will probably be backgroundrb http:// > backgroundrb.rubyforge.org/ > > scott. > On Sep 15, 2006, at 7:10 AM, gama.franco-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote: > > > > > Hi, > > > > Does the rails framework supports the execution of periodic tasks? > > > > Supose that I need to process RSS Feeds to update the database of the > > web application. Is this possible? > > > > Thanks, > > Gama Franco > > > > > > > > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
I''ve used 2 main approaches to this: -cron job that runs a script. We tend to use this for relatively infrequent tasks (eg we have a mailing we send out to users once a day) -long running process that wakes up every so often to do something. We tend to use this for things that run quite often, where it seems silly to be repeatedly loading rails only to ditch it, and then load it again 30 seconds later. Fred -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---