Harden DetMir runtime hot paths

This commit is contained in:
igor04091968
2026-07-01 06:06:01 +03:00
parent fe87c85a31
commit c017cb08a9
15 changed files with 1923 additions and 86 deletions
+11 -1
View File
@@ -275,10 +275,20 @@ impl AwClient {
) -> Result<()> {
for chunk in events.chunks(chunk_size.max(1)) {
let path = format!("/api/0/buckets/{bucket_id}/events");
self.request_json(Method::POST, &path, Some(json!(chunk)), false)?;
self.request_status(Method::POST, &path, Some(json!(chunk)))?;
}
Ok(())
}
fn request_status(&self, method: Method, path: &str, payload: Option<Value>) -> Result<()> {
let response = self.send_retry(method, path, payload)?;
let status = response.status();
if status.is_success() {
Ok(())
} else {
Err(anyhow!("ActivityWatch {path} returned HTTP {status}"))
}
}
}
fn log(message: &str) {