优化算法

This commit is contained in:
2018-03-08 16:37:18 +08:00
parent eabf2878ee
commit d0d88de9fd
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -50,7 +50,6 @@ if __name__ == "__main__":
pro_num = config.get_worker_num()
pool = multiprocessing.Pool(processes=pro_num)
pool.terminate()
for pid in range(0, pro_num):
pool.apply_async(worker, ())
pool.close()
@@ -59,6 +58,8 @@ if __name__ == "__main__":
if os.path.exists("/var/run/price.sys.stop"):
pool.terminate()
break
else:
time.sleep(3)
pool.join()
if os.path.exists("/var/run/price.sys.stop"):
os.remove("/var/run/price.sys.stop")
+1 -1
View File
@@ -8,7 +8,7 @@ def get_logging_config():
def get_worker_num():
return 30
return 2
def get_redis_host():