接口支持查询模板信息,避免使用旧模板
This commit is contained in:
parent
789513a0be
commit
5d58198b7e
6
app.py
6
app.py
@ -4,6 +4,7 @@ import flask
|
|||||||
|
|
||||||
import config
|
import config
|
||||||
import biz.task
|
import biz.task
|
||||||
|
import template
|
||||||
from telemetry import init_opentelemetry
|
from telemetry import init_opentelemetry
|
||||||
from template import load_local_template
|
from template import load_local_template
|
||||||
from util import api
|
from util import api
|
||||||
@ -18,6 +19,11 @@ app = flask.Flask(__name__)
|
|||||||
@app.post('/<task_id>')
|
@app.post('/<task_id>')
|
||||||
def do_task(task_id):
|
def do_task(task_id):
|
||||||
task_info = api.get_task_info(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)
|
biz.task.start_task(task_info)
|
||||||
return "OK"
|
return "OK"
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user