This commit is contained in:
Seth Call 2021-01-04 07:40:49 -06:00
parent 339d63f374
commit fa38b05cb9
3 changed files with 11 additions and 5 deletions

View File

@ -94,7 +94,12 @@ module JamRuby
def get_account(current_user)
account = current_user && current_user.recurly_code ? Recurly::Account.find(current_user.recurly_code) : nil
begin
account = current_user && current_user.recurly_code ? Recurly::Account.find(current_user.recurly_code) : nil
rescue Recurly::Error => x
puts "Swallow find acct for user #{current_user.email} error initial #{x}"
end
# check again, assuming account_code is the user ID (can happen in error scenarios where we create the account
# on recurly, but couldn't save the account_code to the user.recurly_code field)
@ -103,7 +108,7 @@ module JamRuby
begin
account = Recurly::Account.find(current_user.id)
rescue Recurly::Error => x
puts "Swallow find acct error #{x}"
puts "Swallow find acct for user #{current_user.email} error #{x}"
end
# repair user local account info

View File

@ -1455,8 +1455,9 @@ module JamWebsockets
def wipe_all_connections
# meant to be called only on startup; delete all connections fo myself
ConnectionManager.active_record_transaction do |connection_manager|
ConnectionManager.active_record_transaction do |connection_manager, conn|
clients = connection_manager.connection_client_ids_for_gateway(@gateway_name)
@log.info "Cleaning up #{clients.length} clients on startup"
clients.each do |client_id|
cleanup_client_with_id(client_id)
end

View File

@ -38,8 +38,6 @@ module JamWebsockets
@log.info "starting server #{host}:#{port} staleness_time=#{connect_time_stale_client}; reconnect time = #{connect_time_expire_client}, rabbitmq=#{rabbitmq_host}:#{rabbitmq_port} gateway_name=#{gateway_name}"
@router.init
EventMachine.error_handler{|e|
puts "unhandled error #{e}"
puts "unhandled error #{e.backtrace}"
@ -51,6 +49,8 @@ module JamWebsockets
EventMachine.run do
@router.start(connect_time_stale_client, connect_time_expire_client, connect_time_stale_browser, connect_time_expire_browser, host: rabbitmq_host, port: rabbitmq_port, max_connections_per_user: max_connections_per_user, gateway: gateway_name, allow_dynamic_registration: allow_dynamic_registration, chat_enabled: chat_enabled, chat_blast: chat_blast) do
@router.init
#start_connection_expiration
#start_client_expiration
#start_connection_flagger