mirror of
https://github.com/modrinth/code.git
synced 2026-08-30 11:36:05 +00:00
Implement redis clustering (#5189)
Co-authored-by: Jai Agrawal <geometrically@Jais-MacBook-Pro.local>
This commit is contained in:
co-authored by
Jai Agrawal
parent
5c29a8c7dd
commit
fb1050e409
@@ -256,15 +256,16 @@ impl DBOrganization {
|
||||
) -> Result<(), super::DatabaseError> {
|
||||
let mut redis = redis.connect().await?;
|
||||
|
||||
if let Some(slug) = slug {
|
||||
redis
|
||||
.delete(ORGANIZATIONS_TITLES_NAMESPACE, slug.to_lowercase())
|
||||
.await?;
|
||||
}
|
||||
|
||||
redis
|
||||
.delete_many([
|
||||
(ORGANIZATIONS_NAMESPACE, Some(id.0.to_string())),
|
||||
(
|
||||
ORGANIZATIONS_TITLES_NAMESPACE,
|
||||
slug.map(|x| x.to_lowercase()),
|
||||
),
|
||||
])
|
||||
.delete(ORGANIZATIONS_NAMESPACE, id.0.to_string())
|
||||
.await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user