Deadlock fixes (#85)
* fixed deadlock * added missing files to commit * clippy & dist
This commit is contained in:
parent
19a4aa6689
commit
63d2785b2f
@ -1,3 +1,3 @@
|
||||
# Windows has stack overflows when calling from Tauri, so we increase compiler size
|
||||
[target.'cfg(windows)']
|
||||
rustflags = ["-C", "link-args=/STACK:4194304"]
|
||||
rustflags = ["-C", "link-args=/STACK:8388608"]
|
||||
@ -89,19 +89,23 @@ pub async fn list() -> crate::Result<std::collections::HashMap<PathBuf, Profile>
|
||||
#[tracing::instrument]
|
||||
pub async fn sync(path: &Path) -> crate::Result<()> {
|
||||
let state = State::get().await?;
|
||||
let mut profiles = state.profiles.write().await;
|
||||
let result = {
|
||||
let mut profiles: tokio::sync::RwLockWriteGuard<
|
||||
crate::state::Profiles,
|
||||
> = state.profiles.write().await;
|
||||
|
||||
if let Some(profile) = profiles.0.get_mut(path) {
|
||||
profile.sync().await?;
|
||||
State::sync().await?;
|
||||
|
||||
Ok(())
|
||||
} else {
|
||||
Err(
|
||||
crate::ErrorKind::UnmanagedProfileError(path.display().to_string())
|
||||
.as_error(),
|
||||
)
|
||||
}
|
||||
if let Some(profile) = profiles.0.get_mut(path) {
|
||||
profile.sync().await?;
|
||||
Ok(())
|
||||
} else {
|
||||
Err(crate::ErrorKind::UnmanagedProfileError(
|
||||
path.display().to_string(),
|
||||
)
|
||||
.as_error())
|
||||
}
|
||||
};
|
||||
State::sync().await?;
|
||||
result
|
||||
}
|
||||
|
||||
/// Add a project from a version
|
||||
|
||||
@ -26,6 +26,7 @@ impl DirectoryInfo {
|
||||
"Could not find valid config dir".to_string(),
|
||||
))?;
|
||||
|
||||
dbg!(&config_dir);
|
||||
fs::create_dir_all(&config_dir).await.map_err(|err| {
|
||||
crate::ErrorKind::FSError(format!(
|
||||
"Error creating Theseus config directory: {err}"
|
||||
|
||||
2
theseus_gui/.gitignore
vendored
2
theseus_gui/.gitignore
vendored
@ -10,8 +10,6 @@ pnpm-debug.log*
|
||||
lerna-debug.log*
|
||||
|
||||
node_modules
|
||||
dist
|
||||
dist-ssr
|
||||
*.local
|
||||
|
||||
# Editor directories and files
|
||||
|
||||
3
theseus_gui/dist/.gitignore
vendored
Normal file
3
theseus_gui/dist/.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
# exclude everything except this file
|
||||
*
|
||||
!.gitignore
|
||||
@ -19,7 +19,7 @@ theseus = { path = "../../theseus", features = ["tauri"] }
|
||||
|
||||
serde_json = "1.0"
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
tauri = { version = "1.2", features = ["protocol-asset", "window-close", "window-create", "dialog"] }
|
||||
tauri = { version = "1.2", features = ["dialog", "protocol-asset", "window-close", "window-create"] }
|
||||
tokio = { version = "1", features = ["full"] }
|
||||
thiserror = "1.0"
|
||||
tokio-stream = { version = "0.1", features = ["fs"] }
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user