Skip to content

Commit

Permalink
only expose cache entries if not 'nil'
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Drennan authored and Brian Drennan committed Nov 20, 2023
1 parent 37eda95 commit df9e1fa
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions plugins/processors/k8sdecorator/stores/podstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,11 @@ func (p *PodStore) exposeCache() {
} else {
for k, _ := range p.cache.GetAllEntries() {
v := p.getCachedEntryNoLock(k)
remaining := int((p.cache.TTL() - now.Sub(v.creation)) / time.Second)
log.Printf("D! [PodStore.exposecache] Entry: [podKey: %s, remainingTime: %ds]", k, remaining)

if v != nil {
remaining := int((p.cache.TTL() - now.Sub(v.creation)) / time.Second)
log.Printf("D! [PodStore.exposecache] Entry: [podKey: %s, remainingTime: %ds]", k, remaining)
}
}
log.Print("D! [PodStore.exposecache] Finished exposing cache")
}
Expand Down

0 comments on commit df9e1fa

Please sign in to comment.