所有函数都经过try包装
This commit is contained in:
parent
996766a96d
commit
7c93ceabea
|
|
@ -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()
|
||||
try_execute(generate_history_data)
|
||||
try_execute(generate_statistics_data)
|
||||
try_execute(record_milestone_history)
|
||||
try_execute(record_task_history)
|
||||
Loading…
Reference in New Issue