Batch incremental search event consumption (#6468)

* Batch incremental search event consumption

* fmt

* fix
This commit is contained in:
aecsocket
2026-06-22 14:54:02 +00:00
committed by GitHub
parent 0a0ef1ce81
commit b7d097d74d
4 changed files with 154 additions and 54 deletions
@@ -29,6 +29,7 @@ use crate::{
},
queue::session::AuthQueue,
routes::ApiError,
search::SearchState,
util::{
error::Context, http::HttpClient, validate::validation_errors_to_string,
},
@@ -120,6 +121,7 @@ pub async fn create(
redis: web::Data<RedisPool>,
session_queue: web::Data<AuthQueue>,
http: web::Data<HttpClient>,
search_state: web::Data<SearchState>,
web::Json(create): web::Json<ProjectCreate>,
) -> Result<web::Json<ProjectId>, CreateError> {
// check that the user can make a project
@@ -337,6 +339,15 @@ pub async fn create(
.await
.wrap_internal_err("failed to commit transaction")?;
super::super::projects::clear_project_cache_and_queue_search(
&redis,
&search_state,
project_id.into(),
Some(slug),
None,
)
.await?;
Ok(web::Json(project_id))
}