Skip to content

Commit

Permalink
Check the correct value in cache.get()
Browse files Browse the repository at this point in the history
We check the ok from the previous assignment. This commit fixes that.

Signed-off-by: Anastasios Papagiannis <[email protected]>
  • Loading branch information
tpapagian authored and kkourt committed Oct 31, 2022
1 parent 5c8a6b1 commit 113a336
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/process/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ func (pc *Cache) get(processID string) (*ProcessInternal, error) {
errormetrics.ErrorTotalInc(errormetrics.ProcessCacheMissOnGet)
return nil, fmt.Errorf("invalid entry for process ID: %s", processID)
}
process, _ := entry.(*ProcessInternal)
process, ok := entry.(*ProcessInternal)
if !ok {
logger.GetLogger().WithField("process entry", entry).Debug("invalid entry in process cache")
errormetrics.ErrorTotalInc(errormetrics.ProcessCacheMissOnGet)
Expand Down

0 comments on commit 113a336

Please sign in to comment.