优化日志
This commit is contained in:
@@ -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,14 +1,6 @@
|
||||
logging_config = {
|
||||
|
||||
}
|
||||
|
||||
|
||||
def get_logging_config():
|
||||
return logging_config
|
||||
|
||||
|
||||
def get_worker_num():
|
||||
return 10
|
||||
return 20
|
||||
|
||||
|
||||
def get_redis_host():
|
||||
|
||||
Reference in New Issue
Block a user