Defer close of source and sink to prevent error logs. (#2149)

When a room is created via room service, when `StartSession`
runs, it sees a closed request source and returns an error
and that gets logged. It is not a real error.

Defer the sink and source close so that room creation can finish without
errors.
This commit is contained in:
Raja Subramanian
2023-10-17 11:37:34 +05:30
committed by GitHub
parent 53e757fd2c
commit 11c9c56a4d
+2 -2
View File
@@ -84,8 +84,8 @@ func (s *RoomService) CreateRoom(ctx context.Context, req *livekit.CreateRoomReq
if err != nil {
return nil, err
}
sink.Close()
source.Close()
defer sink.Close()
defer source.Close()
// ensure it's created correctly
err = s.confirmExecution(func() error {