Remove old cache config option

This commit is contained in:
Dominik Werder
2023-08-17 15:07:07 +02:00
parent ab6d144ba9
commit 9aec274899
6 changed files with 3 additions and 16 deletions

View File

@@ -24,7 +24,6 @@ pub fn make_test_node(id: u32) -> Node {
port: 8800 + id as u16,
port_raw: 8800 + id as u16 + 100,
// TODO use a common function to supply the tmp path.
cache_base_path: test_data_base_path_databuffer().join(format!("node{:02}", id)),
sf_databuffer: Some(SfDatabuffer {
data_base_path: test_data_base_path_databuffer().join(format!("node{:02}", id)),
ksprefix: "ks".into(),

View File

@@ -77,9 +77,7 @@ impl CacheFileDesc {
pub fn path(&self, node_config: &NodeConfigCached) -> PathBuf {
let hash = self.hash();
let hc = self.hash_channel();
node_config
.node
.cache_base_path
PathBuf::from(format!("{}", err::todoval::<u8>()))
.join("cache")
.join(&hc[0..3])
.join(&hc[3..6])
@@ -175,7 +173,8 @@ pub async fn clear_cache_all(node_config: &NodeConfigCached, dry: bool) -> Resul
}
let mut dirs = VecDeque::new();
let mut stack = VecDeque::new();
stack.push_front(node_config.node.cache_base_path.join("cache"));
// stack.push_front(node_config.node.cache_base_path.join("cache"));
stack.push_front(PathBuf::from("UNDEFINED/NOTHING/REMOVE/ME").join("cache"));
loop {
match stack.pop_front() {
Some(path) => {

View File

@@ -115,7 +115,6 @@ pub async fn gen_test_data() -> Result<(), Error> {
listen: None,
port: 7780 + i1 as u16,
port_raw: 7780 + i1 as u16 + 100,
cache_base_path: data_base_path.join(format!("node{:02}", i1)),
sf_databuffer: Some(SfDatabuffer {
data_base_path: data_base_path.join(format!("node{:02}", i1)),
ksprefix: ksprefix.clone(),

View File

@@ -16,8 +16,6 @@ use netpod::ServiceVersion;
#[derive(Debug, ThisError)]
pub enum EventDataError {
HttpBadMethod,
HttpBadAccept,
QueryParse,
#[error("Error({0})")]
Error(Box<dyn ToPublicError>),
@@ -27,8 +25,6 @@ pub enum EventDataError {
impl ToPublicError for EventDataError {
fn to_public_error(&self) -> String {
match self {
EventDataError::HttpBadMethod => format!("{self}"),
EventDataError::HttpBadAccept => format!("{self}"),
EventDataError::QueryParse => format!("{self}"),
EventDataError::Error(e) => e.to_public_error(),
EventDataError::InternalError => format!("{self}"),

View File

@@ -386,7 +386,6 @@ pub struct Node {
pub port: u16,
#[serde(deserialize_with = "serde_port::port_from_any", default)]
pub port_raw: u16,
pub cache_base_path: PathBuf,
pub sf_databuffer: Option<SfDatabuffer>,
pub archiver_appliance: Option<ArchiverAppliance>,
pub channel_archiver: Option<ChannelArchiver>,
@@ -474,7 +473,6 @@ impl Node {
listen: None,
port: 4444,
port_raw: 4444,
cache_base_path: PathBuf::new(),
sf_databuffer: Some(SfDatabuffer {
data_base_path: PathBuf::new(),
ksprefix: "daqlocal".into(),
@@ -2936,7 +2934,6 @@ pub fn test_cluster() -> Cluster {
listen: None,
port: 6170 + id as u16,
port_raw: 6170 + id as u16 + 100,
cache_base_path: test_data_base_path_databuffer().join(format!("node{:02}", id)),
sf_databuffer: Some(SfDatabuffer {
data_base_path: test_data_base_path_databuffer().join(format!("node{:02}", id)),
ksprefix: "ks".into(),
@@ -2973,7 +2970,6 @@ pub fn sls_test_cluster() -> Cluster {
listen: None,
port: 6190 + id as u16,
port_raw: 6190 + id as u16 + 100,
cache_base_path: test_data_base_path_databuffer().join(format!("node{:02}", id)),
sf_databuffer: None,
archiver_appliance: None,
channel_archiver: Some(ChannelArchiver {
@@ -3008,7 +3004,6 @@ pub fn archapp_test_cluster() -> Cluster {
listen: None,
port: 6200 + id as u16,
port_raw: 6200 + id as u16 + 100,
cache_base_path: test_data_base_path_databuffer().join(format!("node{:02}", id)),
sf_databuffer: None,
channel_archiver: None,
archiver_appliance: Some(ArchiverAppliance {

View File

@@ -71,7 +71,6 @@ fn raw_data_00() {
listen: None,
port: 9090,
port_raw: 9090,
cache_base_path: "".into(),
sf_databuffer: Some(SfDatabuffer {
data_base_path: "/home/dominik/daqbuffer-testdata/databuffer/node00".into(),
ksprefix: "ks".into(),