Only load PIDs for state cleaning

This commit is contained in:
Daniel 2020-11-27 17:19:51 +01:00
parent 454a234449
commit 52d6875bc8

View file

@ -92,12 +92,12 @@ func (p *Process) Delete() {
// CleanProcessStorage cleans the storage from old processes. // CleanProcessStorage cleans the storage from old processes.
func CleanProcessStorage(activePIDs map[int]struct{}) { func CleanProcessStorage(activePIDs map[int]struct{}) {
// add system table of processes // add system table of processes
procs, err := processInfo.Processes() pids, err := processInfo.Pids()
if err != nil { if err != nil {
log.Warningf("process: failed to get list of active PIDs: %s", err) log.Warningf("process: failed to get list of active PIDs: %s", err)
} else { } else {
for _, p := range procs { for _, pid := range pids {
activePIDs[int(p.Pid)] = struct{}{} activePIDs[int(pid)] = struct{}{}
} }
} }