improved injected files

This commit is contained in:
2025-09-23 00:53:15 +09:30
parent 787a1050a5
commit c2142fc23b
3 changed files with 19 additions and 3 deletions
+10 -2
View File
@@ -27,13 +27,21 @@ def register_routes(app):
Create a new task and insert it into the database.
"""
data = request.get_json()
logger.debug(f"Received create_task request: {data}")
worker_id = data.get("worker_id")
job_details = json.dumps(data.get("job_details"))
job_details_dict = data.get("job_details")
job_details = json.dumps(job_details_dict) if job_details_dict else None
task_type = data.get("task_type", "default")
depends_on = data.get("depends_on")
not_before = data.get("not_before")
logger.info(f"Creating new task for worker {worker_id}")
logger.info(f"Creating new task for worker {worker_id}, type {task_type}")
if job_details_dict and "containers" in job_details_dict:
for container in job_details_dict["containers"]:
if "injected_files" in container:
logger.info(f"Task contains injected_files for container {container.get('container_name', 'unknown')}")
else:
logger.debug(f"No injected_files for container {container.get('container_name', 'unknown')}")
if not worker_id or not job_details:
return jsonify({"error": "worker_id and job_details are required"}), 400