disable cache from redis

- reason from value not updated

Signed-off-by: Pakin <pakin.t@forth.co.th>
This commit is contained in:
Pakin 2026-05-18 09:56:23 +07:00
parent b70a35135c
commit a69ef7b927

View file

@ -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)