fix(labrinth): ensure versions get removed from search indexes before ending route execution (#3789)

* fix(labrinth): ensure versions get removed from search indexes before ending route execution

* chore: run `sqlx prepare`

* chore(labrinth): simplify `remove_documents` a little

* chore: tweak new comment
This commit is contained in:
Alejandro González
2025-06-16 17:48:04 +02:00
committed by GitHub
parent 5bdff3929b
commit 97e4d8e132
41 changed files with 888 additions and 971 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -958,7 +958,7 @@ pub async fn version_delete(
)
.await?;
transaction.commit().await?;
remove_documents(&[version.inner.id.into()], &search_config).await?;
database::models::DBProject::clear_cache(
version.inner.project_id,
None,
@@ -966,6 +966,7 @@ pub async fn version_delete(
&redis,
)
.await?;
remove_documents(&[version.inner.id.into()], &search_config).await?;
if result.is_some() {
Ok(HttpResponse::NoContent().body(""))