Merge branch 'vrfs192'

This commit is contained in:
Jonathan Kolyer 2013-02-11 00:42:24 -06:00
commit bb370a3bb0
7 changed files with 12 additions and 5 deletions

View File

@ -43,6 +43,7 @@ gem 'sendgrid', '1.1.0'
gem 'recaptcha', '0.3.4'
gem 'filepicker-rails', '0.0.2'
gem 'aws-sdk', '1.8.0'
gem 'aasm', '3.0.16'
#group :libv8 do
# gem 'libv8', "~> 3.11.8"

View File

@ -1,6 +1,8 @@
object @connection
attributes :ip_address, :client_id
attribute :aasm_state => :connection_state
node(:user_id, :if => lambda { |connection| connection.user.friends?(current_user) }) do |connection|
connection.user_id
end

View File

@ -11,7 +11,7 @@ child(:connections => :participants) {
attributes :ip_address, :client_id
node :user do |connection|
{ :id => connection.user.id, :photo_url => connection.user.photo_url, :name => connection.user.name, :is_friend => connection.user.friends?(current_user) }
{ :id => connection.user.id, :photo_url => connection.user.photo_url, :name => connection.user.name, :is_friend => connection.user.friends?(current_user), :connection_state => connection.aasm_state }
end
child(:tracks => :tracks) {

View File

@ -88,7 +88,8 @@ module SampleApp
# Websocket-gateway embedded configs
config.websocket_gateway_enable = false
config.websocket_gateway_max_stale_connection_time = 1800
config.websocket_gateway_connect_time_stale = 30
config.websocket_gateway_connect_time_expire = 180
config.websocket_gateway_internal_debug = false
config.websocket_gateway_port = 6767

View File

@ -50,7 +50,8 @@ SampleApp::Application.configure do
# Websocket-gateway embedded configs
config.websocket_gateway_enable = true
config.websocket_gateway_max_stale_connection_time = 30
config.websocket_gateway_connect_time_stale = 30
config.websocket_gateway_connect_time_expire = 180
config.websocket_gateway_internal_debug = false
config.websocket_gateway_port = 6777

View File

@ -31,6 +31,7 @@ module JamWebEventMachine
end
def self.die_gracefully_on_signal
Rails.logger.debug("*** die_gracefully_on_signal")
Signal.trap("INT") { EM.stop }
Signal.trap("TERM") { EM.stop }
end

View File

@ -2,5 +2,6 @@ if Rails.application.config.websocket_gateway_enable
JamWebsockets::Server.new.run :port => Rails.application.config.websocket_gateway_port,
:emwebsocket_debug => Rails.application.config.websocket_gateway_internal_debug,
:max_stale_connection_time => Rails.application.config.websocket_gateway_max_stale_connection_time
end
:connect_time_stale => Rails.application.config.websocket_gateway_connect_time_stale,
:connect_time_expire => Rails.application.config.websocket_gateway_connect_time_expire
end