Spaces:
Runtime error

arami21 commited on
Commit
35fed8c
·
verified ·
1 Parent(s): 3754b15

Update src/main.rs

Browse files
Files changed (1) hide show
  1. src/main.rs +7 -5
src/main.rs CHANGED
@@ -19,8 +19,9 @@ use sqlx::{PgPool, prelude::FromRow};
19
 
20
  #[actix_web::main]
21
  async fn main() -> std::io::Result<()> {
 
22
  dotenvy::dotenv().ok();
23
-
24
  let pool = match db().await {
25
  Ok(pool) => {
26
  println!("Database connected!");
@@ -34,15 +35,16 @@ async fn main() -> std::io::Result<()> {
34
  ));
35
  }
36
  };
37
-
38
  let secret_key = std::env::var("SECRET_KEY").expect("SECRET_KEY not found");
39
-
40
  let key = Key::from(secret_key.as_bytes());
41
-
42
  let redis_url = std::env::var("REDIS_URL").expect("REDIS_URL not found");
43
 
44
  let session_store = RedisSessionStore::new(redis_url).await.unwrap();
45
-
 
46
  HttpServer::new(move || {
47
  App::new()
48
  .app_data(Data::new(pool.clone()))
 
19
 
20
  #[actix_web::main]
21
  async fn main() -> std::io::Result<()> {
22
+ println!("Start Program");
23
  dotenvy::dotenv().ok();
24
+ println!("Load Env Ok");
25
  let pool = match db().await {
26
  Ok(pool) => {
27
  println!("Database connected!");
 
35
  ));
36
  }
37
  };
38
+ println!("Database Connection!");
39
  let secret_key = std::env::var("SECRET_KEY").expect("SECRET_KEY not found");
40
+ println!("secrect key ok!");
41
  let key = Key::from(secret_key.as_bytes());
42
+ println!("redis url ok!");
43
  let redis_url = std::env::var("REDIS_URL").expect("REDIS_URL not found");
44
 
45
  let session_store = RedisSessionStore::new(redis_url).await.unwrap();
46
+ println!("session redis ok!");
47
+ println!("Start Server!");
48
  HttpServer::new(move || {
49
  App::new()
50
  .app_data(Data::new(pool.clone()))