fix: log memory statistics only if memory is enabled
All checks were successful
Release Tag / release (push) Successful in 9s
All checks were successful
Release Tag / release (push) Successful in 9s
This commit is contained in:
@@ -112,11 +112,13 @@ func (sc *SteamCache) LogStats() {
|
|||||||
defer sc.mu.Unlock()
|
defer sc.mu.Unlock()
|
||||||
if sc.dirty {
|
if sc.dirty {
|
||||||
|
|
||||||
logger.Logger.Info().
|
if sc.memory != nil { // only log memory if memory is enabled
|
||||||
Str("size", units.HumanSize(float64(sc.memory.Size()))).
|
logger.Logger.Info().
|
||||||
Str("capacity", units.HumanSize(float64(sc.memory.Capacity()))).
|
Str("size", units.HumanSize(float64(sc.memory.Size()))).
|
||||||
Str("files", fmt.Sprintf("%d", len(sc.memory.StatAll()))).
|
Str("capacity", units.HumanSize(float64(sc.memory.Capacity()))).
|
||||||
Msg("memory")
|
Str("files", fmt.Sprintf("%d", len(sc.memory.StatAll()))).
|
||||||
|
Msg("memory")
|
||||||
|
}
|
||||||
|
|
||||||
logger.Logger.Info().
|
logger.Logger.Info().
|
||||||
Str("size", units.HumanSize(float64(sc.disk.Size()))).
|
Str("size", units.HumanSize(float64(sc.disk.Size()))).
|
||||||
|
|||||||
Reference in New Issue
Block a user