fix: log memory statistics only if memory is enabled
All checks were successful
Release Tag / release (push) Successful in 9s

This commit is contained in:
2025-01-22 18:29:19 -06:00
parent b7652ed7cc
commit 3e8a92b865

View File

@@ -112,11 +112,13 @@ func (sc *SteamCache) LogStats() {
defer sc.mu.Unlock()
if sc.dirty {
logger.Logger.Info().
Str("size", units.HumanSize(float64(sc.memory.Size()))).
Str("capacity", units.HumanSize(float64(sc.memory.Capacity()))).
Str("files", fmt.Sprintf("%d", len(sc.memory.StatAll()))).
Msg("memory")
if sc.memory != nil { // only log memory if memory is enabled
logger.Logger.Info().
Str("size", units.HumanSize(float64(sc.memory.Size()))).
Str("capacity", units.HumanSize(float64(sc.memory.Capacity()))).
Str("files", fmt.Sprintf("%d", len(sc.memory.StatAll()))).
Msg("memory")
}
logger.Logger.Info().
Str("size", units.HumanSize(float64(sc.disk.Size()))).