zeta: Smaller reject batches (#43942)

We were allowing the client to build up to
`MAX_EDIT_PREDICTION_REJECTIONS_PER_REQUEST`. We'll now attempt to flush
the rejections when we reach half max.

Release Notes:

- N/A
This commit is contained in:
Agus Zubiaga
2025-12-01 18:10:13 -03:00
committed by GitHub
parent 58c9cbae40
commit efff602909

View File

@@ -993,7 +993,7 @@ impl Zeta {
});
let reached_request_limit =
self.rejected_predictions.len() >= MAX_EDIT_PREDICTION_REJECTIONS_PER_REQUEST;
self.rejected_predictions.len() >= MAX_EDIT_PREDICTION_REJECTIONS_PER_REQUEST / 2;
let reject_tx = self.reject_predictions_tx.clone();
self.reject_predictions_debounce_task = Some(cx.spawn(async move |_this, cx| {
const REJECT_REQUEST_DEBOUNCE: Duration = Duration::from_secs(15);