Prevent stats update if the deltas are empty (#619)

* Prevent stats update if the deltas are empty

* increase force interval

* static check

* Change max delay to 30 seconds
This commit is contained in:
Raja Subramanian
2022-04-18 22:51:34 +05:30
committed by GitHub
parent 2e9bccfeff
commit a19ca69f5f
3 changed files with 24 additions and 5 deletions
+4 -2
View File
@@ -26,7 +26,7 @@ const (
// expire participant mappings after a day
participantMappingTTL = 24 * time.Hour
statsUpdateInterval = 2 * time.Second
statsMaxDelaySeconds = 10
statsMaxDelaySeconds = 30
)
// RedisRouter uses Redis pub/sub to route signaling messages across different nodes
@@ -483,7 +483,9 @@ func (r *RedisRouter) handleRTCMessage(rm *livekit.RTCNodeMessage) error {
if err != nil {
logger.Errorw("could not update node stats", err)
} else {
r.currentNode.Stats = updated
if updated != nil {
r.currentNode.Stats = updated
}
}
r.statsMu.Unlock()