diff --git a/lib/fishjam_web/controllers/peer_controller.ex b/lib/fishjam_web/controllers/peer_controller.ex index c0907534..9b26d2b0 100644 --- a/lib/fishjam_web/controllers/peer_controller.ex +++ b/lib/fishjam_web/controllers/peer_controller.ex @@ -66,8 +66,6 @@ defmodule FishjamWeb.PeerController do ] def create(conn, %{"room_id" => room_id} = params) do - Logger.debug("Successfully added peer to room: #{room_id}") - # the room may crash between fetching its # pid and adding a new peer to it # in such a case, the controller will fail @@ -77,6 +75,8 @@ defmodule FishjamWeb.PeerController do {:ok, peer_type} <- Peer.parse_type(peer_type_string), {:ok, _room_pid} <- RoomService.find_room(room_id), {:ok, peer} <- Room.add_peer(room_id, peer_type, peer_options) do + Logger.debug("Successfully added peer to room: #{room_id}") + assigns = [ peer: peer, token: PeerToken.generate(%{peer_id: peer.id, room_id: room_id}),