beter logging to debug this damn thing
This commit is contained in:
parent
ff21cc8746
commit
988fa276b1
|
|
@ -1481,6 +1481,7 @@ module JamWebsockets
|
|||
Notification.send_friend_update(user_id, false, conn) if count == 0
|
||||
music_session = ActiveMusicSession.find_by_id(music_session_id) unless music_session_id.nil?
|
||||
user = User.find_by_id(user_id) unless user_id.nil?
|
||||
|
||||
if music_session
|
||||
|
||||
msuh = MusicSessionUserHistory.where(client_id: cid).order('created_at DESC').first
|
||||
|
|
@ -1492,8 +1493,9 @@ module JamWebsockets
|
|||
|
||||
recording = music_session.stop_recording
|
||||
unless recording.nil?
|
||||
@log.debug "stopped recording: #{recording.id} because user #{user} reconnected"
|
||||
@log.debug "cleanup_client: stopped recording: #{recording.id} because user #{user} reconnected"
|
||||
recording.discard_if_no_action(user) # throw away this users vote for the
|
||||
@log.debug "cleanup_client: discard complete"
|
||||
recording_id = recording.id unless recording.nil?
|
||||
end
|
||||
|
||||
|
|
@ -1501,12 +1503,16 @@ module JamWebsockets
|
|||
# then throw away the user's
|
||||
most_recent_recording = music_session.most_recent_recording
|
||||
if most_recent_recording && most_recent_recording.users.exists?(user)
|
||||
@log.debug "disarded user's vote for recording: #{most_recent_recording.id} because user #{user} reconnected"
|
||||
@log.debug "cleanup_client: discarded user's vote for recording: #{most_recent_recording.id} because user #{user} reconnected"
|
||||
# if this user was in the most recent recording associated with the session they were just in, discard any tracks they had
|
||||
most_recent_recording.discard_if_no_action(user) # throw away this users vote for the
|
||||
else
|
||||
@log.debug "cleanup_client: no recent recording to clean up"
|
||||
end
|
||||
|
||||
|
||||
music_session.with_lock do # VRFS-1297
|
||||
@log.debug("cleanup_client: tick track changes")
|
||||
music_session.tick_track_changes
|
||||
end
|
||||
end
|
||||
|
|
@ -1514,7 +1520,9 @@ module JamWebsockets
|
|||
end
|
||||
|
||||
if user && music_session
|
||||
@log.info("Send session depart message for #{user} to #{music_session.id}")
|
||||
Notification.send_session_depart(music_session, cid, user, recording_id)
|
||||
@log.info("Sent session depart")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -57,6 +57,8 @@ module JamWebsockets
|
|||
# if you don't do this, the app won't exit unless you kill -9
|
||||
at_exit do
|
||||
@log.info "cleaning up server"
|
||||
@log.info "Exit error: #{$ERROR_INFO}" if $ERROR_INFO
|
||||
@log.info "Exit position: #{$ERROR_POSITION}" if $ERROR_POSITION
|
||||
@router.cleanup
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in New Issue