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.
func CleanProcessStorage(activePIDs map[int]struct{}) {
// add system table of processes
procs, err := processInfo.Processes()
pids, err := processInfo.Pids()
if err != nil {
log.Warningf("process: failed to get list of active PIDs: %s", err)
} else {
for _, p := range procs {
activePIDs[int(p.Pid)] = struct{}{}
for _, pid := range pids {
activePIDs[int(pid)] = struct{}{}
}
}