From f54073d12229452f864a311179e2229789470623 Mon Sep 17 00:00:00 2001 From: wangwenyan Date: Tue, 13 Mar 2018 09:39:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PriceSystem/CalcCmdReceiver.py | 5 +++-- PriceSystem/config/__init__.py | 10 +--------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/PriceSystem/CalcCmdReceiver.py b/PriceSystem/CalcCmdReceiver.py index bc86fe3..fc161f9 100644 --- a/PriceSystem/CalcCmdReceiver.py +++ b/PriceSystem/CalcCmdReceiver.py @@ -19,8 +19,9 @@ def worker(): while True: try: cmd = client.lpop(QUEUE) - except: + except Exception as ex: cmd = None + print(ex) if cmd is None: time.sleep(60) logger.info("等待接受计算命令") @@ -35,7 +36,7 @@ def worker(): print(ex) logger.exception(ex) end_time = time.clock() - logger.error("Calc ERROR :" + str(cmd) + "\t计算失败,耗时:" + (end_time - start_time), ex) + logger.error("Calc ERROR :" + str(cmd) + "\t计算失败,耗时:" + (end_time - start_time)) def format_cmd(cmd): diff --git a/PriceSystem/config/__init__.py b/PriceSystem/config/__init__.py index 5127572..cef8843 100644 --- a/PriceSystem/config/__init__.py +++ b/PriceSystem/config/__init__.py @@ -1,14 +1,6 @@ -logging_config = { - -} - - -def get_logging_config(): - return logging_config - def get_worker_num(): - return 10 + return 20 def get_redis_host():