Permalink
Browse files

Update generated script to control daemon

  • Loading branch information...
1 parent 4e589c9 commit 071ec2fc677846cdb1fc3a964211ecdbf6c55d69 @afcapel committed Nov 3, 2012
Showing with 5 additions and 9 deletions.
  1. +5 −9 lib/generators/alondra/templates/alondra
@@ -15,16 +15,12 @@ options = {
Daemons.run_proc 'alondra', options do
ENV["ALONDRA_SERVER"] = 'true'
-
+
require_relative File.join('..', 'config', 'environment')
-
- log_path = File.expand_path(File.join(File.dirname(__FILE__), '..', 'log', 'alondra.log'))
-
- Rails.logger = ActiveSupport::BufferedLogger.new(log_path)
- Log.info "Started alondra server on port #{Alondra::Alondra.config.port}... #{EM.reactor_running?}"
+ Rails.logger.info "Started alondra server on port #{Alondra::Alondra.config.port}... #{EM.reactor_running?}"
+
+ Alondra::Alondra.start_server_in_new_thread!.join
- EM.reactor_thread.join
-
- Log.info 'Alondra server terminated'
+ Rails.logger.info 'Alondra server terminated'
end

0 comments on commit 071ec2f

Please sign in to comment.