This commit is contained in:
2018-03-08 17:36:02 +08:00
parent f566ccd340
commit 9717328795
+5 -5
View File
@@ -47,8 +47,8 @@ def format_cmd(cmd):
if __name__ == "__main__":
if os.path.exists("/var/run/price.sys.stop"):
os.remove("/var/run/price.sys.stop")
if os.path.exists("/var/run/price/price.sys.stop"):
os.remove("/var/run/price/price.sys.stop")
pro_num = config.get_worker_num()
pool = multiprocessing.Pool(processes=pro_num)
for pid in range(0, pro_num):
@@ -56,11 +56,11 @@ if __name__ == "__main__":
pool.close()
logger.info("均价系统启动成功")
while True:
if os.path.exists("/var/run/price.sys.stop"):
if os.path.exists("/var/run/price/price.sys.stop"):
pool.terminate()
break
else:
time.sleep(3)
if os.path.exists("/var/run/price.sys.stop"):
os.remove("/var/run/price.sys.stop")
if os.path.exists("/var/run/price/price.sys.stop"):
os.remove("/var/run/price/price.sys.stop")
pool.join()