优化
This commit is contained in:
@@ -48,11 +48,6 @@ def format_cmd(cmd):
|
|||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
||||||
pid_file = open("/var/run/price.sys.pid", "w")
|
|
||||||
pid_file.write(str(os.getpid()))
|
|
||||||
pid_file.flush()
|
|
||||||
pid_file.close()
|
|
||||||
|
|
||||||
pro_num = config.get_worker_num()
|
pro_num = config.get_worker_num()
|
||||||
pool = multiprocessing.Pool(processes=pro_num)
|
pool = multiprocessing.Pool(processes=pro_num)
|
||||||
pool.terminate()
|
pool.terminate()
|
||||||
@@ -66,4 +61,4 @@ if __name__ == "__main__":
|
|||||||
break
|
break
|
||||||
pool.join()
|
pool.join()
|
||||||
if os.path.exists("/var/run/price.sys.stop"):
|
if os.path.exists("/var/run/price.sys.stop"):
|
||||||
os.remove("/var/run/price.sys.stop")
|
os.remove("/var/run/price.sys.stop")
|
||||||
|
|||||||
Reference in New Issue
Block a user