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