From 089e1bb2dee7b1db42a6983ff7763325e60265cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Szuma?= Date: Wed, 29 May 2024 14:19:52 +0200 Subject: [PATCH] Move Logger.debug --- lib/fishjam_web/controllers/peer_controller.ex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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}),