diff --git a/src/app.rs b/src/app.rs index a4a8a7d..cf20e75 100644 --- a/src/app.rs +++ b/src/app.rs @@ -125,24 +125,6 @@ async fn checkout_handler( // ); // quick response from redis - if let Ok(conn) = state.redis.dedicated_connection().await { - println!("conneciton ok"); - if let Ok(raw) = fetch_content_from_redis_byte(conn, &fpath).await - && !raw.is_empty() - { - // detect content type - let content_type = detect_content_type(&fpath); - - println!("content-len: {}", raw.len()); - - return Response::builder() - .header(header::CONTENT_TYPE, content_type) - .body(Body::from(raw)) - .unwrap(); - } - } - - println!("failed to get from redis, continue ..."); let repo = state.repo.clone(); @@ -186,18 +168,6 @@ async fn checkout_handler( let key_clone = fpath.clone(); let data_clone = o.clone(); - tokio::spawn(async move { - if let Ok(mut conn) = state_clone.redis.dedicated_connection().await { - let _: Result<(), _> = redis::cmd("SET") - .arg(&key_clone) - .arg(&data_clone) - .arg("EX") - .arg(3600) - .query_async(&mut conn) - .await; - } - }); - let content_type = detect_content_type(&fpath); Response::builder() .header(header::CONTENT_TYPE, content_type)