lib/daemons/appstats_log_collector.rb in appstats-0.1.0 vs lib/daemons/appstats_log_collector.rb in appstats-0.3.1
- old
+ new
@@ -30,13 +30,15 @@
ActiveRecord::Base.establish_connection(appstats_config['database'])
require File.join(File.dirname(__FILE__),"..","appstats")
Appstats.log(:info,"Started Appstats Log Collector")
while($running) do
+ ActiveRecord::Base.connection.reconnect!
appstats_config["remote_servers"].each do |remote_server|
Appstats::LogCollector.find_remote_files(remote_server,remote_server[:path],remote_server[:template])
end
Appstats::LogCollector.download_remote_files(appstats_config["remote_servers"])
Appstats::LogCollector.process_local_files
+ ActiveRecord::Base.connection.disconnect!
a_day_in_seconds = 60*60*24
sleep a_day_in_seconds
end
\ No newline at end of file