mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-12-01 10:40:14 +08:00
perf(runtime-bundle): share destination strings with tristr
Share destination storage within bundle planning and preserve the Service wire strings and provider readback.
This commit is contained in:
@@ -619,14 +619,14 @@ async fn collect_service_runtime_bundle(config_file: &Path) -> Result<RuntimeBun
|
||||
.into_iter()
|
||||
.map(|asset| RuntimeAsset {
|
||||
source: asset.source,
|
||||
destination: asset.destination,
|
||||
destination: asset.destination.into(),
|
||||
})
|
||||
.collect(),
|
||||
remote_providers: plan
|
||||
.remote_providers
|
||||
.into_iter()
|
||||
.map(|provider| RemoteProvider {
|
||||
destination: provider.destination,
|
||||
destination: provider.destination.into(),
|
||||
url: provider.url,
|
||||
})
|
||||
.collect(),
|
||||
@@ -968,7 +968,7 @@ async fn sync_runtime_providers_by_service() -> Result<ProviderSync> {
|
||||
let loaded_before = provider_load_times().await;
|
||||
let mut fetched = Vec::new();
|
||||
for declared in applied_remote_providers(&runtime, &app_dir)? {
|
||||
let (temp, file) = match create_sync_temp(&app_dir.join(&declared.destination)).await {
|
||||
let (temp, file) = match create_sync_temp(&app_dir.join(declared.destination.as_str())).await {
|
||||
Ok(created) => created,
|
||||
Err(error) => {
|
||||
logging!(warn, Type::Service, "{error:#}");
|
||||
@@ -1137,7 +1137,7 @@ async fn publish_fetched(
|
||||
};
|
||||
let mut synced = 0;
|
||||
for cache in fetched {
|
||||
let target = app_dir.join(&cache.declared.destination);
|
||||
let target = app_dir.join(cache.declared.destination.as_str());
|
||||
if !declared.contains(&cache.declared) || same_contents(&cache.temp, &target).await {
|
||||
remove_temp(&cache.temp).await;
|
||||
continue;
|
||||
@@ -1214,7 +1214,7 @@ async fn recheck_identity(
|
||||
cache: &FetchedCache,
|
||||
) -> Result<Fetch> {
|
||||
let request = RuntimeFileRequest {
|
||||
destination: cache.declared.destination.to_owned(),
|
||||
destination: cache.declared.destination.as_str().to_owned(),
|
||||
offset: cache.len,
|
||||
};
|
||||
Ok(match read_chunk(credentials, session, &request).await? {
|
||||
|
||||
Reference in New Issue
Block a user