Skip to content

Commit

Permalink
user_disconnect event trigger should be in begin
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandred committed Sep 18, 2015
1 parent b33818d commit 861762e
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lib/volt/server/socket_connection_handler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,14 @@ def closed
# Remove ourself from the available channels
@@channels.delete(self)

# Trigger a user disconnect event even if the user hasn't logged out
if @user_id
@@dispatcher.volt_app.trigger!("user_disconnect", @user_id)
end

begin
@@dispatcher.close_channel(self)

# Trigger a user disconnect event even if the user hasn't logged out
if @user_id
@@dispatcher.volt_app.trigger!("user_disconnect", @user_id)
end

rescue DRb::DRbConnError => e
# ignore drb read of @@dispatcher error if child has closed
end
Expand Down

0 comments on commit 861762e

Please sign in to comment.