proxmox-rrd: cleanup list_old_journals
This commit is contained in:
parent
2b05008a11
commit
d26865c52c
|
@ -122,9 +122,15 @@ impl JournalState {
|
||||||
for entry in std::fs::read_dir(&self.config.basedir)? {
|
for entry in std::fs::read_dir(&self.config.basedir)? {
|
||||||
let entry = entry?;
|
let entry = entry?;
|
||||||
let path = entry.path();
|
let path = entry.path();
|
||||||
if path.is_file() {
|
|
||||||
if let Some(stem) = path.file_stem() {
|
if !path.is_file() { continue; }
|
||||||
if stem != OsStr::new("rrd") { continue; }
|
|
||||||
|
match path.file_stem() {
|
||||||
|
None => continue,
|
||||||
|
Some(stem) if stem != OsStr::new("rrd") => continue,
|
||||||
|
Some(_) => (),
|
||||||
|
}
|
||||||
|
|
||||||
if let Some(extension) = path.extension() {
|
if let Some(extension) = path.extension() {
|
||||||
if let Some(extension) = extension.to_str() {
|
if let Some(extension) = extension.to_str() {
|
||||||
if let Some(rest) = extension.strip_prefix("journal-") {
|
if let Some(rest) = extension.strip_prefix("journal-") {
|
||||||
|
@ -139,8 +145,6 @@ impl JournalState {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
list.sort_unstable_by_key(|entry| entry.time);
|
list.sort_unstable_by_key(|entry| entry.time);
|
||||||
Ok(list)
|
Ok(list)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue