优化
This commit is contained in:
@@ -21,7 +21,6 @@ def worker():
|
||||
cmd = client.lpop(QUEUE)
|
||||
except Exception as ex:
|
||||
cmd = None
|
||||
print(ex)
|
||||
if cmd is None:
|
||||
time.sleep(60)
|
||||
logger.info("等待接受计算命令")
|
||||
@@ -33,10 +32,9 @@ def worker():
|
||||
end_time = time.time()
|
||||
logger.info("Calc SUC:" + str(cmd) + "\t计算成功,耗时:" + str(end_time - start_time))
|
||||
except BaseException as ex:
|
||||
print(ex)
|
||||
logger.exception(ex)
|
||||
end_time = time.time()
|
||||
logger.error("Calc ERROR :" + str(cmd) + "\t计算失败,耗时:" + (end_time - start_time))
|
||||
logger.error("Calc ERROR :" + str(cmd) + "\t计算失败,耗时:" + str(end_time - start_time))
|
||||
|
||||
|
||||
def format_cmd(cmd):
|
||||
|
||||
Reference in New Issue
Block a user