032: dead code cleanup — remove sync APIClient, _llm_http, preview_llm_client, fix retry chains
This commit is contained in:
@@ -132,7 +132,7 @@ def run_translation(
|
||||
# @PRE User has translate.job.execute permission.
|
||||
# @POST Returns the updated translation run.
|
||||
@router.post("/runs/{run_id}/retry")
|
||||
def retry_run(
|
||||
async def retry_run(
|
||||
run_id: str,
|
||||
current_user: User = Depends(get_current_user),
|
||||
_ = Depends(has_permission("translate.job", "EXECUTE")),
|
||||
@@ -143,7 +143,7 @@ def retry_run(
|
||||
logger.reason(f"retry_run — Run: {run_id}, User: {current_user.username}", extra={"src": "translate_routes"})
|
||||
try:
|
||||
orch = TranslationOrchestrator(db, config_manager, current_user.username)
|
||||
run = orch.retry_failed_batches(run_id)
|
||||
run = await orch.retry_failed_batches(run_id)
|
||||
return _run_to_response(run)
|
||||
except ValueError as e:
|
||||
raise HTTPException(status_code=status.HTTP_400_BAD_REQUEST, detail=str(e))
|
||||
@@ -158,7 +158,7 @@ def retry_run(
|
||||
# @PRE User has translate.job.execute permission.
|
||||
# @POST Returns the updated run.
|
||||
@router.post("/runs/{run_id}/retry-insert")
|
||||
def retry_insert(
|
||||
async def retry_insert(
|
||||
run_id: str,
|
||||
current_user: User = Depends(get_current_user),
|
||||
_ = Depends(has_permission("translate.job", "EXECUTE")),
|
||||
@@ -169,7 +169,7 @@ def retry_insert(
|
||||
logger.reason(f"retry_insert — Run: {run_id}, User: {current_user.username}", extra={"src": "translate_routes"})
|
||||
try:
|
||||
orch = TranslationOrchestrator(db, config_manager, current_user.username)
|
||||
run = orch.retry_insert(run_id)
|
||||
run = await orch.retry_insert(run_id)
|
||||
return _run_to_response(run)
|
||||
except ValueError as e:
|
||||
raise HTTPException(status_code=status.HTTP_400_BAD_REQUEST, detail=str(e))
|
||||
|
||||
Reference in New Issue
Block a user