diff options
| author | shihaoyue <[email protected]> | 2024-08-27 15:50:48 +0800 |
|---|---|---|
| committer | shihaoyue <[email protected]> | 2024-08-27 15:50:48 +0800 |
| commit | 12664dd83e6601cf942b243d2565f9854f018768 (patch) | |
| tree | 315ac8ed6ba644e94d64ab257acc348d9400657a /agent | |
| parent | c939ef5ed7a0afd5bc2c506ad439fc8131fc4cfc (diff) | |
updata 结束标识
Diffstat (limited to 'agent')
| -rw-r--r-- | agent/apps/script.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/agent/apps/script.py b/agent/apps/script.py index 6cefa54..7d490f0 100644 --- a/agent/apps/script.py +++ b/agent/apps/script.py @@ -4,7 +4,6 @@ import subprocess from concurrent.futures import ThreadPoolExecutor import threading import time -import uuid from flask import request, jsonify from apiflask import APIBlueprint from apiflask.fields import String @@ -112,13 +111,16 @@ def execute_command(cmd, job_id, stop_event): "info" : remaining_output}) if response.status_code != 200: print(f"Failed to send remaining log to server for job {job_id}: {response.text}") - + response = requests.post(f"http://{server_url}/agent/res", json={"id" : config['id'], + "taskpolicy" : job_id, + "level" : "INFO", + "info" : "finish"}) except subprocess.CalledProcessError as e: with tasks_lock: tasks[job_id]['output'] = e.output response = requests.post(f"http://{server_url}/agent/res", json={"id" : config['id'], "taskpolicy" : job_id, - "level" : "INFO", + "level" : "ERROR", "info" : e.output}) if response.status_code != 200: print(f"Failed to send error log to server for job {job_id}: {response.text}") |
