pathfix
This commit is contained in:
parent
6c659e1c8e
commit
f931a9288e
11
src/main.rs
11
src/main.rs
|
@ -10,13 +10,6 @@ use tokio::task::JoinHandle;
|
|||
|
||||
mod data;
|
||||
|
||||
macro_rules! log {
|
||||
($($arg:tt)*) => {{
|
||||
let timestamp = Local::now().format("%Y-%m-%d %H:%M:%S%.3f");
|
||||
println!("[{}] {}", timestamp, format_args!($($arg)*));
|
||||
}};
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
struct AppState {
|
||||
tasks: Arc<Mutex<HashMap<String, JoinHandle<()>>>>,
|
||||
|
@ -122,9 +115,9 @@ async fn main() -> std::io::Result<()> {
|
|||
tasks: tasks.clone(),
|
||||
redis: client.clone(),
|
||||
};
|
||||
log!("Redis client initialized");
|
||||
println!("Redis client initialized");
|
||||
HttpServer::new(move || {
|
||||
log!("Webserver initialized");
|
||||
println!("Webserver initialized");
|
||||
App::new()
|
||||
.app_data(web::Data::new(state.clone()))
|
||||
.route("/", web::get().to(connect_handler))
|
||||
|
|
Loading…
Reference in New Issue
Block a user