mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-19 13:07:56 +00:00
misc/cpu-watcher.tac: tolerate missing pidfiles, just skip over that sample
This commit is contained in:
parent
d44fc9fb88
commit
4863b17371
@ -57,14 +57,19 @@ def read_pids_txt():
|
||||
name = parts[1]
|
||||
else:
|
||||
name = pidthing
|
||||
pid = None
|
||||
try:
|
||||
pid = int(pidthing)
|
||||
except ValueError:
|
||||
pidfile = os.path.expanduser(pidthing)
|
||||
if os.path.isdir(pidfile):
|
||||
pidfile = os.path.join(pidfile, "twistd.pid")
|
||||
pid = int(open(pidfile, "r").read().strip())
|
||||
processes.append( (pid, name) )
|
||||
try:
|
||||
pid = int(open(pidfile, "r").read().strip())
|
||||
except EnvironmentError:
|
||||
pass
|
||||
if pid is not None:
|
||||
processes.append( (pid, name) )
|
||||
return processes
|
||||
|
||||
Averages = ListOf( TupleOf(str, float, float, float) )
|
||||
|
Loading…
Reference in New Issue
Block a user