diff --git a/src/main.rs b/src/main.rs index 2e398fb..2b87121 100644 --- a/src/main.rs +++ b/src/main.rs @@ -27,7 +27,6 @@ use askama::Template; use asklyphe_common::nats; use asklyphe_common::nats::comms; use asklyphe_common::nats::searchservice::{SearchSrvcQuery, SearchSrvcRequest, SearchSrvcResponse}; -use asklyphe_common::rustflake::Snowflake; use async_nats::jetstream; use axum::{Extension, Router}; use axum::extract::Query; @@ -101,12 +100,6 @@ async fn main() { emergency: env::var("EMERGENCY").unwrap_or("0".to_string()).eq("1"), }; - let mut snowflake_factory = Snowflake { - worker_id: process::id() as i64, - datacenter_id: opts.datacenter_id, - ..Default::default() - }; - if opts.loki_addr.is_some() { //let (layer, task) = tracing_loki::builder() // .label("environment", "dev").unwrap() @@ -155,7 +148,6 @@ async fn main() { .route("/admin/allusers", get(admin_user_list)) .route("/announcements/:slug", get(announcement_full)) .layer(CorsLayer::new().allow_methods([Method::GET, Method::POST]).allow_origin(AllowOrigin::exact(HeaderValue::from_str("localhost").unwrap()))) - .layer(Extension(Arc::new(Mutex::new(snowflake_factory)))) .layer(Extension(nats.clone())) .layer(Extension(opts.clone())) .fallback(routes::not_found); diff --git a/src/routes/index.rs b/src/routes/index.rs index e1938e0..fa7d199 100644 --- a/src/routes/index.rs +++ b/src/routes/index.rs @@ -21,7 +21,6 @@ use asklyphe_common::nats::authservice::announcements::{LatestAnnouncementReques use asklyphe_common::nats::authservice::profile::{UserInfoRequest, UserInfoResponse}; use asklyphe_common::nats::comms; use asklyphe_common::nats::comms::{ServiceError, ServiceResponse}; -use asklyphe_common::rustflake::Snowflake; use async_nats::jetstream; use axum::Extension; use axum::response::Redirect; diff --git a/src/routes/search.rs b/src/routes/search.rs index 2553874..0c90393 100644 --- a/src/routes/search.rs +++ b/src/routes/search.rs @@ -27,7 +27,6 @@ use asklyphe_common::nats::comms; use asklyphe_common::nats::searchservice::{ SearchSrvcQuery, SearchSrvcRequest, SearchSrvcResponse, }; -use asklyphe_common::rustflake::Snowflake; use async_nats::jetstream; use axum::extract::Query; use axum::http::StatusCode; @@ -337,7 +336,6 @@ struct SearchJson { pub async fn search_json( jar: CookieJar, Query(params): Query>, - Extension(_snowflake_factory): Extension>>, Extension(nats): Extension>, Extension(opts): Extension, ) -> String { diff --git a/src/routes/user_settings.rs b/src/routes/user_settings.rs index 908d40d..df53dee 100644 --- a/src/routes/user_settings.rs +++ b/src/routes/user_settings.rs @@ -19,7 +19,6 @@ use asklyphe_common::nats::authservice::{AuthError, AuthRequest, AuthResponse, A use asklyphe_common::nats::authservice::profile::{ThemeChangeRequest, ThemeChangeResponse, UserInfoRequest, UserInfoResponse}; use asklyphe_common::nats::comms; use asklyphe_common::nats::comms::{ServiceError, ServiceResponse}; -use asklyphe_common::rustflake::Snowflake; use async_nats::jetstream; use axum::{Extension, Form}; use axum::response::Redirect;