Skip to content

Commit

Permalink
Merge branch 'main' into Cleaned-up-most-warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
tristanpoland authored Dec 21, 2024
2 parents 5aa26fc + 71804df commit f6e31ed
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,23 @@
// Caznix //
// License: Apache-2.0 //
//=============================================================================//
static CTRL_C_HANDLER: Once = Once::new();

use std::sync::Once;
use once_cell::sync::Lazy;
use splash::splash;
use anyhow::{Context, Result};

use horizon_logger::{HorizonLogger, log_info};

mod server;



modserver;
mod splash;
// mod collision;

static CTRL_C_HANDLER: Once = Once::new();

//------------------------------------------------------------------------------
// Global Logger Configuration
//------------------------------------------------------------------------------
Expand All @@ -50,14 +56,13 @@ async fn main() -> Result<()> {

splash();
let config_init_time = std::time::Instant::now();
//let server_config: std::sync::Arc<server::config::ServerConfig> = server_config().context("Failed to obtain server config")?;
log_info!(LOGGER, "INIT", "Server config loaded in {:#?}", config_init_time.elapsed());

let init_time = std::time::Instant::now();

// Start the server
server::start().await.context("Failed to start server")?;

println!("Server started in {:#?}", init_time.elapsed());

let mut terminating: bool = false;

Expand All @@ -71,9 +76,8 @@ async fn main() -> Result<()> {
std::process::exit(0);

}
},

).expect("Failed to handle Ctrl+C");
})
.expect("Failed to register ctrl+c handler");
});
Ok(())
}

0 comments on commit f6e31ed

Please sign in to comment.