* VRFS-2045 - fixing tests that use websocket-gateway, pass in 20 instead of defaulting of 0 for max connections

This commit is contained in:
Seth Call 2014-08-14 13:16:38 -05:00
parent 5c9f0da222
commit 30b2c1bb53
4 changed files with 4 additions and 2 deletions

View File

@ -115,7 +115,7 @@ if defined?(Bundler)
# Runs the websocket gateway within the web app
config.websocket_gateway_uri = "ws://localhost:#{config.websocket_gateway_port}/websocket"
config.websocket_gateway_trusted_uri = "ws://localhost:#{config.websocket_gateway_port + 1}/websocket"
config.websocket_gateway_max_connections_per_user = 10
config.websocket_gateway_max_connections_per_user = 20
config.external_hostname = ENV['EXTERNAL_HOSTNAME'] || 'localhost'
config.external_port = ENV['EXTERNAL_PORT'] || 3000

View File

@ -12,7 +12,7 @@ unless $rails_rake_task
:connect_time_stale_client => APP_CONFIG.websocket_gateway_connect_time_stale_client,
:connect_time_expire_client => APP_CONFIG.websocket_gateway_connect_time_expire_client,
:connect_time_stale_browser => APP_CONFIG.websocket_gateway_connect_time_stale_browser,
:connect_time_expire_browser=> APP_CONFIG.websocket_gateway_connect_time_expire_browser,
:connect_time_expire_browser => APP_CONFIG.websocket_gateway_connect_time_expire_browser,
:max_connections_per_user => APP_CONFIG.websocket_gateway_max_connections_per_user,
:rabbitmq_host => APP_CONFIG.rabbitmq_host,
:rabbitmq_port => APP_CONFIG.rabbitmq_port,

View File

@ -82,6 +82,7 @@ Thread.new do
:connect_time_expire_client => 6,
:connect_time_stale_browser => 4,
:connect_time_expire_browser => 6,
:max_connections_per_user => 20,
:rabbitmq_host => 'localhost',
:rabbitmq_port => 5672,
:calling_thread => current,

View File

@ -570,6 +570,7 @@ module JamWebsockets
# protect against this user swamping the server
if Connection.where(user_id: user.id).count >= @max_connections_per_user
@log.warn "user #{user.id}/#{user.email} unable to connect due to max_connections_per_user #{@max_connections_per_user}"
raise SessionError, 'max_user_connections'
end