优化算法
This commit is contained in:
@@ -50,7 +50,6 @@ if __name__ == "__main__":
|
|||||||
|
|
||||||
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()
|
|
||||||
for pid in range(0, pro_num):
|
for pid in range(0, pro_num):
|
||||||
pool.apply_async(worker, ())
|
pool.apply_async(worker, ())
|
||||||
pool.close()
|
pool.close()
|
||||||
@@ -59,6 +58,8 @@ if __name__ == "__main__":
|
|||||||
if os.path.exists("/var/run/price.sys.stop"):
|
if os.path.exists("/var/run/price.sys.stop"):
|
||||||
pool.terminate()
|
pool.terminate()
|
||||||
break
|
break
|
||||||
|
else:
|
||||||
|
time.sleep(3)
|
||||||
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")
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ def get_logging_config():
|
|||||||
|
|
||||||
|
|
||||||
def get_worker_num():
|
def get_worker_num():
|
||||||
return 30
|
return 2
|
||||||
|
|
||||||
|
|
||||||
def get_redis_host():
|
def get_redis_host():
|
||||||
|
|||||||
Reference in New Issue
Block a user