phase 5, fix critical issues
This commit is contained in:
@@ -434,7 +434,6 @@ mod tests {
|
|||||||
Some(6789.0),
|
Some(6789.0),
|
||||||
],
|
],
|
||||||
extra_fields: HashMap::new(),
|
extra_fields: HashMap::new(),
|
||||||
status_array: vec![],
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-3
@@ -14,7 +14,7 @@ use tokio::net::TcpListener;
|
|||||||
use tracing_subscriber::EnvFilter;
|
use tracing_subscriber::EnvFilter;
|
||||||
|
|
||||||
fn init_logging() {
|
fn init_logging() {
|
||||||
let filter = EnvFilter::from_default_env();
|
let filter = EnvFilter::try_from_default_env().unwrap_or_else(|_| EnvFilter::new("info"));
|
||||||
|
|
||||||
if std::env::var("HAGFISH_LOG_FORMAT").as_deref() == Ok("json") {
|
if std::env::var("HAGFISH_LOG_FORMAT").as_deref() == Ok("json") {
|
||||||
tracing_subscriber::fmt()
|
tracing_subscriber::fmt()
|
||||||
@@ -34,8 +34,8 @@ fn cleanup_stale_parquet_files() {
|
|||||||
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") {
|
if name.starts_with("hagfish-") && name.ends_with(".parquet") {
|
||||||
if let Ok(metadata) = entry.metadata() {
|
if let Ok(metadata) = entry.metadata() {
|
||||||
let age = std::time::SystemTime::now()
|
if let Ok(modified) = metadata.modified() {
|
||||||
.duration_since(metadata.modified().unwrap());
|
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());
|
||||||
}
|
}
|
||||||
@@ -44,6 +44,7 @@ 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