change: add case retry for premium

Signed-off-by: Pakin <pakin.t@forth.co.th>
This commit is contained in:
Pakin 2026-03-24 10:23:12 +07:00
parent f365f7d626
commit cb773ab3ec

View file

@ -371,7 +371,7 @@ async fn read(
Err(_) => { Err(_) => {
let lvc = latest_version.clone(); let lvc = latest_version.clone();
// concurrent fetch // concurrent fetch
for i in 1..5 { for i in 1..6 {
let latest_version_c = lvc.clone(); let latest_version_c = lvc.clone();
retry_cnt = i; retry_cnt = i;
// retry #1: get from redis // retry #1: get from redis
@ -524,6 +524,10 @@ fn get_key_cache(country: String, version: String, is_patch: bool, retry_cnt: i3
// do checkout // do checkout
format!("{country}/coffeethai02_{version}.json") format!("{country}/coffeethai02_{version}.json")
} }
5 => {
// checkout case premium
format!("{country}/coffeethai02_1{version}.json")
}
_ => "".to_string(), _ => "".to_string(),
} }
} }
@ -752,6 +756,7 @@ impl AppState {
#[tokio::main] #[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> { async fn main() -> Result<(), Box<dyn std::error::Error>> {
println!("Hello, world!"); println!("Hello, world!");
//println!("{}", include_str!("main.rs"));
dotenv::dotenv().ok(); dotenv::dotenv().ok();
env_logger::init(); env_logger::init();