feature/edit-tag #66
16
src/faces.rs
16
src/faces.rs
@@ -2311,6 +2311,12 @@ async fn update_face_handler<D: FaceDao>(
|
|||||||
let mut new_embedding: Option<Vec<u8>> = None;
|
let mut new_embedding: Option<Vec<u8>> = None;
|
||||||
if let Some((bx, by, bw, bh)) = bbox_patch {
|
if let Some((bx, by, bw, bh)) = bbox_patch {
|
||||||
if !face_client.is_enabled() {
|
if !face_client.is_enabled() {
|
||||||
|
warn!(
|
||||||
|
"PATCH /image/faces/{}: 503 — face client not enabled \
|
||||||
|
(APOLLO_FACE_API_BASE_URL / APOLLO_API_BASE_URL both unset). \
|
||||||
|
Bbox edit requires Apollo to re-embed.",
|
||||||
|
id
|
||||||
|
);
|
||||||
return HttpResponse::ServiceUnavailable()
|
return HttpResponse::ServiceUnavailable()
|
||||||
.body("face client disabled — bbox edit requires Apollo");
|
.body("face client disabled — bbox edit requires Apollo");
|
||||||
}
|
}
|
||||||
@@ -2387,9 +2393,19 @@ async fn update_face_handler<D: FaceDao>(
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
Err(FaceDetectError::Transient(e)) => {
|
Err(FaceDetectError::Transient(e)) => {
|
||||||
|
warn!(
|
||||||
|
"PATCH /image/faces/{}: 503 — Apollo face client transient \
|
||||||
|
error during re-embed: {}",
|
||||||
|
id, e
|
||||||
|
);
|
||||||
return HttpResponse::ServiceUnavailable().body(format!("{}", e));
|
return HttpResponse::ServiceUnavailable().body(format!("{}", e));
|
||||||
}
|
}
|
||||||
Err(FaceDetectError::Disabled) => {
|
Err(FaceDetectError::Disabled) => {
|
||||||
|
warn!(
|
||||||
|
"PATCH /image/faces/{}: 503 — face client became disabled \
|
||||||
|
mid-flight",
|
||||||
|
id
|
||||||
|
);
|
||||||
return HttpResponse::ServiceUnavailable().body("face client disabled mid-flight");
|
return HttpResponse::ServiceUnavailable().body("face client disabled mid-flight");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user