fixed critical stall bug on first card

This commit is contained in:
Steven 2023-08-04 20:18:05 -04:00
parent aa4559be2a
commit 6cd610e727
3 changed files with 11 additions and 13 deletions

View file

@ -1,8 +1,6 @@
use dotenv;
use tokio::time::Duration;
use prometheus::Registry;
use tracing::info;
use std::sync::Arc;
mod server;
mod cards;
@ -11,7 +9,7 @@ mod handlers;
mod util;
use server::run_server;
use cards::{CARD_VALUES,get_data_update_interval};
use cards::{setup_registry, get_data_update_interval};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
@ -33,9 +31,3 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
cards::process_cards(&mut interval).await?;
}
}
fn setup_registry() -> Result<Arc<Registry>, Box<dyn std::error::Error>> {
let registry = Arc::new(Registry::new());
registry.register(Box::new(CARD_VALUES.clone())).unwrap();
Ok(registry)
}