接口支持查询模板信息,避免使用旧模板

This commit is contained in:
Jerry Yan 2025-04-28 17:57:34 +08:00
parent 789513a0be
commit 5d58198b7e

6
app.py
View File

@ -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('/<task_id>')
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"