优化日志

This commit is contained in:
2018-03-13 09:39:23 +08:00
parent c351000c5b
commit f54073d122
2 changed files with 4 additions and 11 deletions
+3 -2
View File
@@ -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):
+1 -9
View File
@@ -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():