mirror of
https://github.com/titanscouting/tra-superscript.git
synced 2024-11-10 06:54:45 +00:00
fixed delay in daemon stopping
This commit is contained in:
parent
ba793140af
commit
1d9fa99058
@ -291,11 +291,13 @@ def stop(pid_path):
|
|||||||
except IOError:
|
except IOError:
|
||||||
sys.stderr.write("pidfile at <" + pid_path + "> does not exist. Daemon not running?\n")
|
sys.stderr.write("pidfile at <" + pid_path + "> does not exist. Daemon not running?\n")
|
||||||
return
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
os.kill(pid, SIGTERM)
|
while True:
|
||||||
return
|
os.kill(pid, SIGTERM)
|
||||||
|
time.sleep(0.01)
|
||||||
except OSError as err:
|
except OSError as err:
|
||||||
|
err = str(err)
|
||||||
if err.find("No such process") > 0:
|
if err.find("No such process") > 0:
|
||||||
if os.path.exists(pid_path):
|
if os.path.exists(pid_path):
|
||||||
os.remove(pid_path)
|
os.remove(pid_path)
|
||||||
|
Loading…
Reference in New Issue
Block a user