This commit is contained in:
parent
86bc122c5f
commit
b1e455ca48
|
@ -8,11 +8,15 @@ PIDFILE = '/tmp/uengine-runner.pid'
|
||||||
#程序结束时清理pid
|
#程序结束时清理pid
|
||||||
@atexit.register
|
@atexit.register
|
||||||
def remove_pid():
|
def remove_pid():
|
||||||
with open(PIDFILE) as pidfile:
|
try:
|
||||||
pidlst = pidfile.readlines()
|
with open(PIDFILE) as pidfile:
|
||||||
pidlst.remove(str(PID)+'\n')
|
pidlst = pidfile.readlines()
|
||||||
with open(PIDFILE,'w') as pidfile:
|
pidlst.remove(str(PID)+'\n')
|
||||||
pidfile.writelines(pidlst)
|
with open(PIDFILE,'w') as pidfile:
|
||||||
|
pidfile.writelines(pidlst)
|
||||||
|
except:
|
||||||
|
# 忽略
|
||||||
|
pass
|
||||||
|
|
||||||
#更新时结束进程
|
#更新时结束进程
|
||||||
def main():
|
def main():
|
||||||
|
|
Loading…
Reference in New Issue