cleanup
This commit is contained in:
@@ -10,7 +10,7 @@ use tokio::signal;
|
||||
use tokio::sync::Mutex;
|
||||
// use tower_governor::{governor::GovernorConfigBuilder, GovernorLayer};
|
||||
use tower_http::{
|
||||
cors::{Any, CorsLayer},
|
||||
cors::CorsLayer,
|
||||
trace::{self, TraceLayer},
|
||||
};
|
||||
use tracing_subscriber::{filter, layer::SubscriberExt, prelude::*, util::SubscriberInitExt};
|
||||
@@ -58,11 +58,6 @@ async fn main() {
|
||||
)
|
||||
.init();
|
||||
|
||||
let cors = CorsLayer::new()
|
||||
.allow_methods(Any)
|
||||
.allow_headers(Any)
|
||||
.allow_origin(Any);
|
||||
|
||||
// if std::env::var("RUST_ENV").unwrap_or_else(|_| "development".to_string()) != "development" {
|
||||
//println!("we're not in development, starting up the rate limiter");
|
||||
//let governor_conf = Arc::new(
|
||||
@@ -133,7 +128,6 @@ async fn main() {
|
||||
.on_response(trace::DefaultOnResponse::new().level(tracing::Level::INFO)),
|
||||
)
|
||||
.fallback(routes::root::RootRoute::not_found);
|
||||
// .layer(cors);
|
||||
//.layer(GovernorLayer {
|
||||
// config: governor_conf,
|
||||
//});
|
||||
@@ -170,5 +164,3 @@ async fn shutdown_signal() {
|
||||
_ = terminate => {},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@@ -8,7 +8,7 @@ use serde::{Deserialize, Deserializer};
|
||||
pub fn register(pool: &sqlx::Pool<sqlx::Postgres>) {
|
||||
let p = pool.clone();
|
||||
tokio::spawn(async move {
|
||||
let _ = import_posts("app/", &p).await;
|
||||
let _ = import_posts("/app/posts", &p).await;
|
||||
});
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user