diff --git a/PriceSystem/CalcCmdReceiver.py b/PriceSystem/CalcCmdReceiver.py index 6bad4f3..39981ff 100644 --- a/PriceSystem/CalcCmdReceiver.py +++ b/PriceSystem/CalcCmdReceiver.py @@ -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") diff --git a/PriceSystem/config/__init__.py b/PriceSystem/config/__init__.py index 8862b15..b6539c8 100644 --- a/PriceSystem/config/__init__.py +++ b/PriceSystem/config/__init__.py @@ -8,7 +8,7 @@ def get_logging_config(): def get_worker_num(): - return 30 + return 2 def get_redis_host():