Skip to content

Take control over your live stream video by running it yourself. Streaming + chat out of the box.

Move unlock

Gabe Kangas1ffea5d43dbb
diff --git a/utils/performanceTimer.go b/utils/performanceTimer.go
index a872ab27ca..689d9ffb84 100644
--- a/utils/performanceTimer.go
+++ b/utils/performanceTimer.go
@@ -32,13 +32,14 @@ func GetAveragePerformance(key string) float64 {
}
l.Lock()
+ defer l.Unlock()
+
delta := time.Since(timestamp).Seconds()
_durationStorage[key] = append(_durationStorage[key], delta)
if len(_durationStorage[key]) < 8 {
return 0
}
_durationStorage[key] = removeHighValue(_durationStorage[key])
- l.Unlock()
return avg(_durationStorage[key])
}