1
0

Implement redis clustering (#5189)

Co-authored-by: Jai Agrawal <geometrically@Jais-MacBook-Pro.local>
This commit is contained in:
Jai Agrawal
2026-01-23 04:51:17 -08:00
committed by GitHub
parent 5c29a8c7dd
commit fb1050e409
13 changed files with 200 additions and 124 deletions

View File

@@ -953,20 +953,20 @@ impl DBProject {
) -> Result<(), DatabaseError> {
let mut redis = redis.connect().await?;
redis
.delete_many([
(PROJECTS_NAMESPACE, Some(id.0.to_string())),
(PROJECTS_SLUGS_NAMESPACE, slug.map(|x| x.to_lowercase())),
(
PROJECTS_DEPENDENCIES_NAMESPACE,
if clear_dependencies.unwrap_or(false) {
Some(id.0.to_string())
} else {
None
},
),
])
.await?;
redis.delete(PROJECTS_NAMESPACE, id.0.to_string()).await?;
if let Some(slug) = slug {
redis
.delete(PROJECTS_SLUGS_NAMESPACE, slug.to_lowercase())
.await?;
}
if clear_dependencies.unwrap_or(false) {
redis
.delete(PROJECTS_DEPENDENCIES_NAMESPACE, id.0.to_string())
.await?;
}
Ok(())
}
}