mirror of
https://github.com/kemko/nomad.git
synced 2026-01-01 16:05:42 +03:00
Fix nil dereference
This commit is contained in:
@@ -184,8 +184,13 @@ func (a *AllocGarbageCollector) keepUsageBelowThreshold() error {
|
||||
}
|
||||
|
||||
// See if we are below thresholds for used disk space and inode usage
|
||||
diskStats := a.statsCollector.Stats().AllocDirStats
|
||||
// TODO(diptanu) figure out why this is nil
|
||||
stats := a.statsCollector.Stats()
|
||||
if stats == nil {
|
||||
break
|
||||
}
|
||||
|
||||
diskStats := stats.AllocDirStats
|
||||
if diskStats == nil {
|
||||
break
|
||||
}
|
||||
|
||||
@@ -156,8 +156,8 @@ func (h *HostStatsCollector) Collect() error {
|
||||
hs.Uptime = uptime
|
||||
|
||||
h.hostStatsLock.Lock()
|
||||
defer h.hostStatsLock.Unlock()
|
||||
h.hostStats = hs
|
||||
h.hostStatsLock.Unlock()
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user