Karthi kn
2008-Oct-22 07:06 UTC
Problem adding the OpenWFEru scheduler code in Initialzers
Hi,
I am using OpenWFEru gem for scheduling the weekly mailing in my rails
application. I have written the scheduler code as a stand-alone ruby
code. So I have to run it separately.
But I want this scheduler to start when I start my rails server. I tried
putting this ruby code in config/initializers. But the server is not
getting started as this scheduler code keeps on running.
Following is my ruby code in config/initializers.
require ''openwfe/util/scheduler''
include OpenWFE
scheduler = Scheduler.new
scheduler.start
scheduler.schedule(''0 9 * * 1'') do
system "ruby D:\\Projects\\Producteering\\script\\runner
Person.send_weekly_digest"
end
scheduler.join
Am I doing anything wrong? Or is there any way to achieve this?
Thanks in advance...
--
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?hl=en
-~----------~----~----~----~------~----~------~--~---