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
+2 -2
View File
@@ -4,9 +4,10 @@ import (
"sync" "sync"
"time" "time"
"github.com/livekit/protocol/utils"
"github.com/livekit/livekit-server/pkg/logger" "github.com/livekit/livekit-server/pkg/logger"
livekit "github.com/livekit/livekit-server/proto" 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 // 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() { func (r *LocalRouter) Stop() {
r.rtcMessageChan.Close() r.rtcMessageChan.Close()
} }
+1 -2
View File
@@ -156,8 +156,7 @@ func (t *DataTrack) forwardWorker() {
for _, sub := range t.subscribers { for _, sub := range t.subscribers {
err := sub.SendMessage(msg) err := sub.SendMessage(msg)
if err != nil { if err != nil {
logger.Errorw("could not send data message", logger.Errorw("could not send data message", err,
err,
"source", t.participantId, "source", t.participantId,
"dest", sub.participantId) "dest", sub.participantId)
} }
+1 -1
View File
@@ -1,6 +1,6 @@
// Code generated by Wire. DO NOT EDIT. // Code generated by Wire. DO NOT EDIT.
//go:generate wire //go:generate go run github.com/google/wire/cmd/wire
//+build !wireinject //+build !wireinject
package service package service
+6 -9
View File
@@ -9,17 +9,17 @@ import (
"time" "time"
"github.com/go-redis/redis/v8" "github.com/go-redis/redis/v8"
"github.com/livekit/livekit-server/pkg/testutils" "github.com/livekit/protocol/auth"
testclient "github.com/livekit/livekit-server/test/client" "github.com/livekit/protocol/utils"
"github.com/twitchtv/twirp" "github.com/twitchtv/twirp"
"github.com/livekit/livekit-server/pkg/config" "github.com/livekit/livekit-server/pkg/config"
"github.com/livekit/livekit-server/pkg/logger" "github.com/livekit/livekit-server/pkg/logger"
"github.com/livekit/livekit-server/pkg/routing" "github.com/livekit/livekit-server/pkg/routing"
"github.com/livekit/livekit-server/pkg/service" "github.com/livekit/livekit-server/pkg/service"
"github.com/livekit/livekit-server/pkg/testutils"
livekit "github.com/livekit/livekit-server/proto" livekit "github.com/livekit/livekit-server/proto"
"github.com/livekit/protocol/auth" testclient "github.com/livekit/livekit-server/test/client"
"github.com/livekit/protocol/utils"
) )
const ( const (
@@ -112,7 +112,6 @@ func waitForServerToStart(s *service.LivekitServer) {
func waitUntilConnected(t *testing.T, clients ...*testclient.RTCClient) { func waitUntilConnected(t *testing.T, clients ...*testclient.RTCClient) {
logger.Infow("waiting for clients to become connected") logger.Infow("waiting for clients to become connected")
wg := sync.WaitGroup{} wg := sync.WaitGroup{}
errChan := make(chan error, len(clients))
for i := range clients { for i := range clients {
c := clients[i] c := clients[i]
wg.Add(1) wg.Add(1)
@@ -120,15 +119,13 @@ func waitUntilConnected(t *testing.T, clients ...*testclient.RTCClient) {
defer wg.Done() defer wg.Done()
err := c.WaitUntilConnected() err := c.WaitUntilConnected()
if err != nil { if err != nil {
errChan <- err
t.Error(err) t.Error(err)
} }
}() }()
} }
wg.Wait() wg.Wait()
close(errChan) if t.Failed() {
for err := range errChan { t.FailNow()
t.Fatal(err)
} }
} }