Spaces:
Sleeping
Sleeping
Fix: Complete lazy initialization for all service references
Browse files- student/api.py +3 -3
student/api.py
CHANGED
|
@@ -155,7 +155,7 @@ async def process_build_request(request: TaskRequest) -> None:
|
|
| 155 |
# Notify evaluation endpoint
|
| 156 |
logger.info(f"Notifying evaluation endpoint for {task_key}")
|
| 157 |
active_tasks[task_key]["status"] = "notifying"
|
| 158 |
-
success = await
|
| 159 |
request.evaluation_url,
|
| 160 |
submission,
|
| 161 |
timeout_minutes=settings.task_timeout_minutes,
|
|
@@ -193,7 +193,7 @@ async def process_update_request(request: TaskRequest) -> None:
|
|
| 193 |
# If directory doesn't exist, treat as new build
|
| 194 |
logger.warning(f"No existing code for {request.task}, creating new")
|
| 195 |
output_dir.mkdir(parents=True, exist_ok=True)
|
| 196 |
-
|
| 197 |
else:
|
| 198 |
# Generate updated code
|
| 199 |
logger.info(f"Updating code for {task_key}")
|
|
@@ -231,7 +231,7 @@ async def process_update_request(request: TaskRequest) -> None:
|
|
| 231 |
# Notify evaluation endpoint
|
| 232 |
logger.info(f"Notifying evaluation endpoint for {task_key}")
|
| 233 |
active_tasks[task_key]["status"] = "notifying"
|
| 234 |
-
success = await
|
| 235 |
request.evaluation_url,
|
| 236 |
submission,
|
| 237 |
timeout_minutes=settings.task_timeout_minutes,
|
|
|
|
| 155 |
# Notify evaluation endpoint
|
| 156 |
logger.info(f"Notifying evaluation endpoint for {task_key}")
|
| 157 |
active_tasks[task_key]["status"] = "notifying"
|
| 158 |
+
success = await get_notification_client().notify_with_timeout(
|
| 159 |
request.evaluation_url,
|
| 160 |
submission,
|
| 161 |
timeout_minutes=settings.task_timeout_minutes,
|
|
|
|
| 193 |
# If directory doesn't exist, treat as new build
|
| 194 |
logger.warning(f"No existing code for {request.task}, creating new")
|
| 195 |
output_dir.mkdir(parents=True, exist_ok=True)
|
| 196 |
+
get_code_generator().generate_app(request, output_dir)
|
| 197 |
else:
|
| 198 |
# Generate updated code
|
| 199 |
logger.info(f"Updating code for {task_key}")
|
|
|
|
| 231 |
# Notify evaluation endpoint
|
| 232 |
logger.info(f"Notifying evaluation endpoint for {task_key}")
|
| 233 |
active_tasks[task_key]["status"] = "notifying"
|
| 234 |
+
success = await get_notification_client().notify_with_timeout(
|
| 235 |
request.evaluation_url,
|
| 236 |
submission,
|
| 237 |
timeout_minutes=settings.task_timeout_minutes,
|