do not retry on region not found

This commit is contained in:
2026-04-14 17:28:57 +08:00
parent c07e5b835e
commit 83279e0253
4 changed files with 20 additions and 6 deletions
+13 -5
View File
@@ -1,14 +1,14 @@
use crate::{CONFIG, SESSION_STORE};
use assets_updater::core::asset_execution::{
should_download_bundle, AssetExecutionContext,
};
use assets_updater::core::asset_execution::{AssetExecutionContext, should_download_bundle};
use assets_updater::core::errors::RegionError;
use assets_updater::core::regions::select_region;
use bytes::Bytes;
use common::http::SyncResponse;
use common::strings::REGION_NOT_FOUND;
use common::updater::SyncContext;
use communicator::http::{json_from_request, send, send_error};
use h2::server::SendResponse;
use h2::RecvStream;
use h2::server::SendResponse;
use http::Request;
pub async fn sync_route(
@@ -24,6 +24,15 @@ pub async fn sync_route(
let region = select_region(&CONFIG.updater_config, &sync_context.region);
if let Err(error) = region {
if let RegionError::NotFound(_) = &error {
send(
send_response,
500,
"text/plain",
format!("{}: {}", REGION_NOT_FOUND, error),
);
return Ok(());
}
send_error(send_response, error.into());
return Ok(());
}
@@ -52,4 +61,3 @@ pub async fn sync_route(
Ok(())
}