imports/inspections

This commit is contained in:
David Colburn
2021-06-04 14:30:10 -05:00
parent c510ea2e1a
commit 5baf97e99b
7 changed files with 19 additions and 23 deletions

View File

@@ -4,9 +4,10 @@ import (
"sync"
"time"
"github.com/livekit/protocol/utils"
"github.com/livekit/livekit-server/pkg/logger"
livekit "github.com/livekit/livekit-server/proto"
"github.com/livekit/protocol/utils"
)
// a router of messages on the same node, basic implementation for local testing
@@ -121,7 +122,6 @@ func (r *LocalRouter) Start() error {
}
func (r *LocalRouter) Stop() {
r.rtcMessageChan.Close()
}

View File

@@ -361,7 +361,7 @@ func (r *RedisRouter) handleSignalMessage(sm *livekit.SignalNodeMessage) error {
switch rmb := sm.Message.(type) {
case *livekit.SignalNodeMessage_Response:
//logger.Debugw("forwarding signal message",
// logger.Debugw("forwarding signal message",
// "connectionId", connectionId,
// "type", fmt.Sprintf("%T", rmb.Response.Message))
if err := resSink.WriteMessage(rmb.Response); err != nil {
@@ -369,7 +369,7 @@ func (r *RedisRouter) handleSignalMessage(sm *livekit.SignalNodeMessage) error {
}
case *livekit.SignalNodeMessage_EndSession:
//logger.Debugw("received EndSession, closing signal connection",
// logger.Debugw("received EndSession, closing signal connection",
// "connectionId", connectionId)
resSink.Close()
}

View File

@@ -32,7 +32,7 @@ type DataTrack struct {
func NewDataTrack(trackId, participantId string, dc *webrtc.DataChannel) *DataTrack {
t := &DataTrack{
//ctx: context.Background(),
// ctx: context.Background(),
id: trackId,
name: dc.Label(),
participantId: participantId,
@@ -156,8 +156,7 @@ func (t *DataTrack) forwardWorker() {
for _, sub := range t.subscribers {
err := sub.SendMessage(msg)
if err != nil {
logger.Errorw("could not send data message",
err,
logger.Errorw("could not send data message", err,
"source", t.participantId,
"dest", sub.participantId)
}

View File

@@ -841,7 +841,7 @@ func (p *ParticipantImpl) handleTrackPublished(track types.PublishedTrack) {
}
func (p *ParticipantImpl) handlePublisherICEStateChange(state webrtc.ICEConnectionState) {
//logger.Debugw("ICE connection state changed", "state", state.String(),
// logger.Debugw("ICE connection state changed", "state", state.String(),
// "participant", p.identity)
if state == webrtc.ICEConnectionStateConnected {
p.updateState(livekit.ParticipantInfo_ACTIVE)
@@ -924,9 +924,9 @@ func (p *ParticipantImpl) rtcpSendWorker() {
if pkts == nil {
return
}
//for _, pkt := range pkts {
// for _, pkt := range pkts {
// logger.Debugw("writing RTCP", "packet", pkt)
//}
// }
if err := p.publisher.pc.WriteRTCP(pkts); err != nil {
logger.Errorw("could not write RTCP to participant", err,
"participant", p.Identity())

View File

@@ -370,7 +370,7 @@ func (r *RoomManager) rtcSessionWorker(room *rtc.Room, participant types.Partici
case *livekit.SignalRequest_Answer:
if participant.State() == livekit.ParticipantInfo_JOINING {
logger.Errorw("cannot negotiate before peer offer", nil, "participant", participant.Identity())
//conn.WriteJSON(jsonError(http.StatusNotAcceptable, "cannot negotiate before peer offer"))
// conn.WriteJSON(jsonError(http.StatusNotAcceptable, "cannot negotiate before peer offer"))
return
}
sd := rtc.FromProtoSessionDescription(msg.Answer)
@@ -383,7 +383,7 @@ func (r *RoomManager) rtcSessionWorker(room *rtc.Room, participant types.Partici
logger.Errorw("could not decode trickle", err, "participant", participant.Identity())
break
}
//logger.Debugw("adding peer candidate", "participant", participant.ID())
// logger.Debugw("adding peer candidate", "participant", participant.ID())
if err := participant.AddICECandidate(candidateInit, msg.Trickle.Target); err != nil {
logger.Errorw("could not handle trickle", err, "participant", participant.Identity())
}

View File

@@ -1,6 +1,6 @@
// Code generated by Wire. DO NOT EDIT.
//go:generate wire
//go:generate go run github.com/google/wire/cmd/wire
//+build !wireinject
package service

View File

@@ -9,17 +9,17 @@ import (
"time"
"github.com/go-redis/redis/v8"
"github.com/livekit/livekit-server/pkg/testutils"
testclient "github.com/livekit/livekit-server/test/client"
"github.com/livekit/protocol/auth"
"github.com/livekit/protocol/utils"
"github.com/twitchtv/twirp"
"github.com/livekit/livekit-server/pkg/config"
"github.com/livekit/livekit-server/pkg/logger"
"github.com/livekit/livekit-server/pkg/routing"
"github.com/livekit/livekit-server/pkg/service"
"github.com/livekit/livekit-server/pkg/testutils"
livekit "github.com/livekit/livekit-server/proto"
"github.com/livekit/protocol/auth"
"github.com/livekit/protocol/utils"
testclient "github.com/livekit/livekit-server/test/client"
)
const (
@@ -34,7 +34,7 @@ const (
syncDelay = 100 * time.Millisecond
// if there are deadlocks, it's helpful to set a short test timeout (i.e. go test -timeout=30s)
// let connection timeout happen
//connectTimeout = 5000 * time.Second
// connectTimeout = 5000 * time.Second
)
var (
@@ -112,7 +112,6 @@ func waitForServerToStart(s *service.LivekitServer) {
func waitUntilConnected(t *testing.T, clients ...*testclient.RTCClient) {
logger.Infow("waiting for clients to become connected")
wg := sync.WaitGroup{}
errChan := make(chan error, len(clients))
for i := range clients {
c := clients[i]
wg.Add(1)
@@ -120,15 +119,13 @@ func waitUntilConnected(t *testing.T, clients ...*testclient.RTCClient) {
defer wg.Done()
err := c.WaitUntilConnected()
if err != nil {
errChan <- err
t.Error(err)
}
}()
}
wg.Wait()
close(errChan)
for err := range errChan {
t.Fatal(err)
if t.Failed() {
t.FailNow()
}
}