Make running the websocket server a little easier

This commit is contained in:
Raphael 2010-09-17 10:44:15 -07:00
parent 99ad001d28
commit 511a4487de
2 changed files with 13 additions and 1 deletions

5
script/server Executable file
View file

@ -0,0 +1,5 @@
#!/bin/bash
mkdir -p -v log/thin/
bundle exec ruby ./script/websocket_server.rb&
bundle exec thin start $@

View file

@ -19,6 +19,7 @@ def process_message
end
begin
EM.run {
Diaspora::WebSocket.initialize_channels
@ -35,7 +36,13 @@ end
ws.onclose { Diaspora::WebSocket.unsubscribe(ws.request['Path'].gsub('/',''), sid) }
}
end
puts "Websocket server started."
process_message
}
rescue RuntimeError => e
raise e unless e.message.include?("no acceptor")
puts "Are you sure the websocket server isn't already running?"
puts "Just start thin with bundle exec thin start."
Process.exit
end