mirror of
https://github.com/jetkvm/kvm.git
synced 2025-09-16 08:38:14 +00:00
This change replaces all instances of GetConfig() function calls with direct access to the Config variable throughout the audio package. The modification improves performance by eliminating function call overhead and simplifies the codebase by removing unnecessary indirection. The commit also includes minor optimizations in validation logic and connection handling, while maintaining all existing functionality. Error handling remains robust with appropriate fallbacks when config values are not available. Additional improvements include: - Enhanced connection health monitoring in UnifiedAudioClient - Optimized validation functions using cached config values - Reduced memory allocations in hot paths - Improved error recovery during quality changes
16 lines
436 B
Go
16 lines
436 B
Go
package audio
|
|
|
|
import "time"
|
|
|
|
// GetMetricsUpdateInterval returns the current metrics update interval from centralized config
|
|
func GetMetricsUpdateInterval() time.Duration {
|
|
return Config.MetricsUpdateInterval
|
|
}
|
|
|
|
// SetMetricsUpdateInterval sets the metrics update interval in centralized config
|
|
func SetMetricsUpdateInterval(interval time.Duration) {
|
|
config := Config
|
|
config.MetricsUpdateInterval = interval
|
|
UpdateConfig(config)
|
|
}
|