From 7c93ceabea5c7826d816e13a55cf3fa5fe2cbcb9 Mon Sep 17 00:00:00 2001 From: lusiyi Date: Thu, 23 Feb 2023 17:12:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=80=E6=9C=89=E5=87=BD=E6=95=B0=E9=83=BD?= =?UTF-8?q?=E7=BB=8F=E8=BF=87try=E5=8C=85=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- project_evaluation_analysis/scheduled_main.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/project_evaluation_analysis/scheduled_main.py b/project_evaluation_analysis/scheduled_main.py index de9107c..7ecc510 100644 --- a/project_evaluation_analysis/scheduled_main.py +++ b/project_evaluation_analysis/scheduled_main.py @@ -1,13 +1,25 @@ import sys import os + +import config + curPath = os.path.abspath(os.path.dirname(__file__)) rootPath = os.path.split(curPath)[0] sys.path.append(rootPath) from generate_history_data import generate_history_data from generate_statistics_data import generate_statistics_data +from generate_milestone_history_data import record_milestone_history +from generate_task_static_history import record_task_history +def try_execute(callback): + try: + callback() + except Exception as e: + config.logger.error(f"执行{callback}出现异常:{e}") if __name__ == '__main__': - generate_history_data() - generate_statistics_data() \ No newline at end of file + try_execute(generate_history_data) + try_execute(generate_statistics_data) + try_execute(record_milestone_history) + try_execute(record_task_history) \ No newline at end of file