logo       

[Rails] Background daemon: msg#03285

RubyonRailsTalk

Subject: [Rails] Background daemon


It's sending e-mail every hour, but I changed to sleep for a day, but
keep send the e-mail by hour. I don't know what to do to send daily.
Could somebody help me?


thanks
############
# mailer.rb
###############
#!/usr/bin/env ruby


# You might want to change this
ENV["RAILS_ENV"] ||= "production"

require File.dirname(__FILE__) + "/../../config/environment"

$running = true
Signal.trap("TERM") do
$running = false
end

while($running) do

Notifier.deliver_report_daily
#ActiveRecord::Base.logger.info "This daemon is still running at
#{Time.now}.\n"

sleep 86400

end

###########
# deploy.rb
############
desc "Stop daemons before deploying"
task :before_deploy do
run "#{current_path}/script/daemons stop"
end

desc "Start daemons after deploying"
task :after_deploy do
run "#{current_path}/script/daemons start"
end
--
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@xxxxxxxxxxxxxxxx
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe@xxxxxxxxxxxxxxxx
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | Mail Home | sitemap | FAQ | advertise