Revert "Implement redis clustering (#5189)"

This reverts commit fb1050e409.
This commit is contained in:
Michael H.
2026-01-23 16:08:07 +01:00
parent fb1050e409
commit 1cf782c298
13 changed files with 124 additions and 200 deletions

View File

@@ -14,6 +14,7 @@ use itertools::Itertools;
use serde::{Deserialize, Serialize};
use std::cmp::Ordering;
use std::collections::HashMap;
use std::iter;
pub const VERSIONS_NAMESPACE: &str = "versions";
const VERSION_FILES_NAMESPACE: &str = "versions_files";
@@ -913,21 +914,24 @@ impl DBVersion {
) -> Result<(), DatabaseError> {
let mut redis = redis.connect().await?;
redis
.delete(VERSIONS_NAMESPACE, version.inner.id.0.to_string())
.await?;
redis
.delete_many(
VERSION_FILES_NAMESPACE,
version.files.iter().flat_map(|file| {
file.hashes
.iter()
.map(|(algo, hash)| Some(format!("{algo}_{hash}")))
}),
iter::once((
VERSIONS_NAMESPACE,
Some(version.inner.id.0.to_string()),
))
.chain(version.files.iter().flat_map(
|file| {
file.hashes.iter().map(|(algo, hash)| {
(
VERSION_FILES_NAMESPACE,
Some(format!("{algo}_{hash}")),
)
})
},
)),
)
.await?;
Ok(())
}
}