添加开始接口

This commit is contained in:
2024-12-13 12:15:15 +08:00
parent 515bf156ab
commit 5ed7198a8a
2 changed files with 11 additions and 0 deletions

View File

@ -107,6 +107,16 @@ def report_task_success(task_info):
return None
def report_task_start(task_info):
try:
response = session.post('{0}/{1}/start'.format(os.getenv('API_ENDPOINT'), task_info.get("id")), json={
'accessKey': os.getenv('ACCESS_KEY'),
}, timeout=10)
except requests.RequestException as e:
logger.error("请求失败!", e)
return None
def report_task_failed(task_info):
try:
response = session.post('{0}/{1}/fail'.format(os.getenv('API_ENDPOINT'), task_info.get("id")), json={