Skip to content

Commit

Permalink
Fixing zombie process monitor bug
Browse files Browse the repository at this point in the history
  • Loading branch information
audaciouscode committed Aug 8, 2017
1 parent 4bca71a commit 89743f6
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions views.py
Expand Up @@ -83,10 +83,13 @@ def zombie_processes(request): # pylint: disable=unused-argument
zombie_count = 0

for pid in psutil.pids():
process = psutil.Process(pid=pid)
try:
process = psutil.Process(pid=pid)

if process.status() == psutil.STATUS_ZOMBIE:
zombie_count += 1
if process.status() == psutil.STATUS_ZOMBIE:
zombie_count += 1
except psutil.AccessDenied:
pass

payload = {
'count': zombie_count
Expand Down

0 comments on commit 89743f6

Please sign in to comment.