3.11: runwatch
This commit is contained in:
parent
7dfac95f1e
commit
8abc7dd8e8
@ -28,10 +28,16 @@ class RunWatch(IntervalModule):
|
||||
return os.path.exists("/proc/{pid}/".format(pid=pid))
|
||||
|
||||
def run(self):
|
||||
with open(glob.glob(self.path)[0], "r") as f:
|
||||
pid = int(f.read().strip())
|
||||
alive = False
|
||||
pid = 0
|
||||
try:
|
||||
with open(glob.glob(self.path)[0], "r") as f:
|
||||
pid = int(f.read().strip())
|
||||
alive = self.is_process_alive(pid)
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
if self.is_process_alive(pid):
|
||||
if alive:
|
||||
fmt = self.format_up
|
||||
color = self.color_up
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user