Fixes from probe controller refactor (#3222)

* Fixes from probe controller refactor

* fmt

* static check
This commit is contained in:
Raja Subramanian
2024-11-30 13:34:01 +05:30
committed by GitHub
parent c76fb0bcf4
commit 8bb29c3a7b
10 changed files with 78 additions and 28 deletions
+4 -2
View File
@@ -16,7 +16,9 @@ package pacer
import (
"sync"
"sync/atomic"
"time"
"go.uber.org/atomic"
"github.com/livekit/livekit-server/pkg/sfu/ccutils"
"github.com/livekit/protocol/logger"
@@ -121,7 +123,7 @@ func (po *ProbeObserver) RecordPacket(size int, isRTX bool, probeClusterId ccuti
notify := false
var clusterId ccutils.ProbeClusterId
if po.pci.Result.EndTime == 0 && po.pci.Result.Bytes() >= po.pci.Goal.DesiredBytes {
if po.pci.Result.EndTime == 0 && ((po.pci.Result.Bytes() >= po.pci.Goal.DesiredBytes) && time.Duration(mono.UnixNano()-po.pci.Result.StartTime) >= po.pci.Goal.Duration) {
po.pci.Result.EndTime = mono.UnixNano()
po.pci.Result.IsCompleted = true