fix clippy errs
This commit is contained in:
+2
-2
@@ -1142,8 +1142,8 @@ mod tests {
|
|||||||
let months: HashSet<_> = body.iter().map(|r| r.month.as_str()).collect();
|
let months: HashSet<_> = body.iter().map(|r| r.month.as_str()).collect();
|
||||||
let species: HashSet<_> = body.iter().map(|r| r.species_code.as_str()).collect();
|
let species: HashSet<_> = body.iter().map(|r| r.species_code.as_str()).collect();
|
||||||
|
|
||||||
assert!(months.len() >= 1);
|
assert!(!months.is_empty());
|
||||||
assert!(species.len() >= 1);
|
assert!(!species.is_empty());
|
||||||
|
|
||||||
for row in &body {
|
for row in &body {
|
||||||
assert!(!row.species_code.is_empty());
|
assert!(!row.species_code.is_empty());
|
||||||
|
|||||||
+6
-7
@@ -60,10 +60,12 @@ fn cleanup_stale_parquet_files() {
|
|||||||
match std::fs::read_dir(&tmp_dir) {
|
match std::fs::read_dir(&tmp_dir) {
|
||||||
Ok(entries) => {
|
Ok(entries) => {
|
||||||
for entry in entries.filter_map(|e| e.ok()) {
|
for entry in entries.filter_map(|e| e.ok()) {
|
||||||
if let Some(name) = entry.file_name().to_str() {
|
if let Some(name) = entry.file_name().to_str()
|
||||||
if name.starts_with("hagfish-") && name.ends_with(".parquet") {
|
&& name.starts_with("hagfish-")
|
||||||
if let Ok(metadata) = entry.metadata() {
|
&& name.ends_with(".parquet")
|
||||||
if let Ok(modified) = metadata.modified() {
|
&& let Ok(metadata) = entry.metadata()
|
||||||
|
&& let Ok(modified) = metadata.modified()
|
||||||
|
{
|
||||||
let age = std::time::SystemTime::now().duration_since(modified);
|
let age = std::time::SystemTime::now().duration_since(modified);
|
||||||
if age.map(|d| d.as_secs() > 3600).unwrap_or(false) {
|
if age.map(|d| d.as_secs() > 3600).unwrap_or(false) {
|
||||||
let _ = std::fs::remove_file(entry.path());
|
let _ = std::fs::remove_file(entry.path());
|
||||||
@@ -71,9 +73,6 @@ fn cleanup_stale_parquet_files() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Err(e) => tracing::warn!(error = %e, "Failed to list temp dir"),
|
Err(e) => tracing::warn!(error = %e, "Failed to list temp dir"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user