Skip to content

Commit

Permalink
fixes #36 more properly
Browse files Browse the repository at this point in the history
  • Loading branch information
tobixen committed Mar 17, 2021
1 parent 6adb614 commit cf0b99c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions thrash-protect.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
## non-critical part of the script, already inside a try-except-scope, so the
## import has been moved there to allow the script to work on servers without 2.7 installed.
#from subprocess import check_output
from os import getenv, kill, getpid, unlink, getpgid, getsid, getpid
from os import getenv, kill, getpid, unlink, getpgid, getsid, getpid, getppid
from collections import namedtuple
import time
from datetime import datetime
Expand Down Expand Up @@ -270,7 +270,7 @@ def scan(self):
oom_score *= config.blacklist_score_multiplier
if oom_score > max:
## ignore self
if pid == getpid():
if pid in (getpid(), getppid()):
continue
max = oom_score
worstpid = (pid, stats.ppid)
Expand Down

0 comments on commit cf0b99c

Please sign in to comment.