diff options
| author | 魏曹先生 <1992414357@qq.com> | 2025-11-17 20:29:27 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2025-11-17 20:29:27 +0800 |
| commit | f73c4c0071bb37430cbf48f7e2d06dcdedb2c8ec (patch) | |
| tree | dc29c89087f7f584ea07a8e3ecf1e71184de82e6 /crates/vcs_actions/src | |
| parent | 7b97b52af021500d8085c875d20215e8dc0f53cc (diff) | |
Use member-specific paths for latest info files
Diffstat (limited to 'crates/vcs_actions/src')
| -rw-r--r-- | crates/vcs_actions/src/actions/local_actions.rs | 31 | ||||
| -rw-r--r-- | crates/vcs_actions/src/actions/virtual_file_actions.rs | 2 |
2 files changed, 23 insertions, 10 deletions
diff --git a/crates/vcs_actions/src/actions/local_actions.rs b/crates/vcs_actions/src/actions/local_actions.rs index c9e5db3..d10c317 100644 --- a/crates/vcs_actions/src/actions/local_actions.rs +++ b/crates/vcs_actions/src/actions/local_actions.rs @@ -1,9 +1,4 @@ -use std::{ - collections::HashMap, - io::{Error, ErrorKind}, - net::SocketAddr, - path::PathBuf, -}; +use std::{collections::HashMap, io::ErrorKind, net::SocketAddr, path::PathBuf}; use action_system::{action::ActionContext, macros::action_gen}; use cfg_file::config::ConfigFile; @@ -191,13 +186,18 @@ pub async fn update_to_latest_info_action( } if ctx.is_proc_on_local() { + let workspace = try_get_local_workspace(&ctx)?; let mut latest_info = instance .lock() .await .read_large_msgpack::<LatestInfo>(512 as u16) .await?; latest_info.update_instant = Some(Instant::now()); - LatestInfo::write(&latest_info).await?; + LatestInfo::write_to( + &latest_info, + LatestInfo::latest_info_path(workspace.local_path(), &member_id), + ) + .await?; } } @@ -206,7 +206,13 @@ pub async fn update_to_latest_info_action( // Sync Remote Sheets { if ctx.is_proc_on_local() { - let Ok(latest_info) = LatestInfo::read().await else { + let workspace = try_get_local_workspace(&ctx)?; + let Ok(latest_info) = LatestInfo::read_from(LatestInfo::latest_info_path( + workspace.local_path(), + &member_id, + )) + .await + else { return Err(TcpTargetError::NotFound( "Latest info not found.".to_string(), )); @@ -301,7 +307,14 @@ pub async fn update_to_latest_info_action( // Sync Held Info { if ctx.is_proc_on_local() { - let Ok(latest_info) = LatestInfo::read().await else { + let workspace = try_get_local_workspace(&ctx)?; + + let Ok(latest_info) = LatestInfo::read_from(LatestInfo::latest_info_path( + workspace.local_path(), + &member_id, + )) + .await + else { return Err(TcpTargetError::NotFound( "Latest info not found.".to_string(), )); diff --git a/crates/vcs_actions/src/actions/virtual_file_actions.rs b/crates/vcs_actions/src/actions/virtual_file_actions.rs index fa71f1b..fa74873 100644 --- a/crates/vcs_actions/src/actions/virtual_file_actions.rs +++ b/crates/vcs_actions/src/actions/virtual_file_actions.rs @@ -1,4 +1,4 @@ -use std::{collections::HashSet, path::PathBuf, sync::Arc, time::SystemTime}; +use std::{collections::HashSet, path::PathBuf, sync::Arc}; use action_system::{action::ActionContext, macros::action_gen}; use cfg_file::config::ConfigFile; |
