mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
Updated gunicorn/pidfile.py
Added a try block to convert the contents of the `pidfile.py` if it can be converted to integer or not. If not, then `wpid` is assigned 0 and the `validate` function returns as usual. If the pidfile has a valid int, the function continues to kill the process as before.
This commit is contained in:
parent
5a8b9555da
commit
80e93b9c55
@ -66,7 +66,10 @@ class Pidfile(object):
|
|||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
with open(self.fname, "r") as f:
|
with open(self.fname, "r") as f:
|
||||||
wpid = int(f.read() or 0)
|
try:
|
||||||
|
wpid = int(f.read())
|
||||||
|
except ValueError:
|
||||||
|
wpid = 0
|
||||||
|
|
||||||
if wpid <= 0:
|
if wpid <= 0:
|
||||||
return
|
return
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user