diff --git a/app.py b/app.py index df8290d..c391a3b 100644 --- a/app.py +++ b/app.py @@ -4,6 +4,7 @@ import flask import config import biz.task +import template from telemetry import init_opentelemetry from template import load_local_template from util import api @@ -18,6 +19,11 @@ app = flask.Flask(__name__) @app.post('/') def do_task(task_id): task_info = api.get_task_info(task_id) + local_template_info = template.get_template_def(task_info.get("templateId")) + template_info = api.get_template_info(task_info.get("templateId")) + if local_template_info: + if local_template_info.get("updateTime") != template_info.get("updateTime"): + template.download_template(task_info.get("templateId")) biz.task.start_task(task_info) return "OK"