debugging; box pinning (#101)

This commit is contained in:
Wyatt Verchere
2023-04-28 10:45:51 -07:00
committed by GitHub
parent dcca0ef474
commit 713a915161
5 changed files with 101 additions and 47 deletions

22
.vscode/launch.json vendored
View File

@@ -133,6 +133,28 @@
}, },
"args": [], "args": [],
"cwd": "${workspaceFolder}" "cwd": "${workspaceFolder}"
},
{
"type": "lldb",
"request": "launch",
"name": "Tauri Development Debug",
"cargo": {
"args": [
"build",
"--manifest-path=./theseus_gui/src-tauri/Cargo.toml",
"--no-default-features"
]
},
"preLaunchTask": "ui:dev"
},
{
"type": "lldb",
"request": "launch",
"name": "Tauri Production Debug",
"cargo": {
"args": ["build", "--release", "--manifest-path=.theseus_gui/src-tauri/Cargo.toml"]
},
"preLaunchTask": "ui:build"
} }
] ]
} }

32
.vscode/tasks.json vendored Normal file
View File

@@ -0,0 +1,32 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "ui:dev",
"type": "shell",
// `dev` keeps running in the background
// ideally you should also configure a `problemMatcher`
// see https://code.visualstudio.com/docs/editor/tasks#_can-a-background-task-be-used-as-a-prelaunchtask-in-launchjson
"isBackground": true,
// change this to your `beforeDevCommand`:
"command": "yarn",
"args": ["dev"],
"options": {
"cwd": "${workspaceFolder}/theseus_gui"
}
},
{
"label": "ui:build",
"type": "shell",
// change this to your `beforeBuildCommand`:
"command": "yarn",
"args": ["build"],
"options": {
"cwd": "${workspaceFolder}/theseus_gui"
}
}
]
}

View File

@@ -89,6 +89,8 @@ pub async fn list() -> crate::Result<std::collections::HashMap<PathBuf, Profile>
/// Query + sync profile's projects with the UI from the FS /// Query + sync profile's projects with the UI from the FS
#[tracing::instrument] #[tracing::instrument]
pub async fn sync(path: &Path) -> crate::Result<()> { pub async fn sync(path: &Path) -> crate::Result<()> {
Box::pin({
async move {
let state = State::get().await?; let state = State::get().await?;
let result = { let result = {
let mut profiles: tokio::sync::RwLockWriteGuard< let mut profiles: tokio::sync::RwLockWriteGuard<
@@ -107,6 +109,9 @@ pub async fn sync(path: &Path) -> crate::Result<()> {
}; };
State::sync().await?; State::sync().await?;
result result
}
})
.await
} }
/// Installs/Repairs a profile /// Installs/Repairs a profile

View File

@@ -138,8 +138,8 @@ impl State {
#[tracing::instrument] #[tracing::instrument]
/// Synchronize in-memory state with persistent state /// Synchronize in-memory state with persistent state
pub async fn sync() -> crate::Result<()> { pub async fn sync() -> crate::Result<()> {
Box::pin(async move {
let state = Self::get().await?; let state = Self::get().await?;
let sync_settings = async { let sync_settings = async {
let state = Arc::clone(&state); let state = Arc::clone(&state);
@@ -164,8 +164,9 @@ impl State {
}; };
tokio::try_join!(sync_settings, sync_profiles)?; tokio::try_join!(sync_settings, sync_profiles)?;
Ok(()) Ok(())
})
.await
} }
/// Reset semaphores to default values /// Reset semaphores to default values

View File

@@ -358,13 +358,7 @@ pub async fn infer_data_from_files(
.filter(|x| x.team_id == project.team) .filter(|x| x.team_id == project.team)
.cloned() .cloned()
.collect::<Vec<_>>(), .collect::<Vec<_>>(),
update_version: if let Some(val) = update_version: update_versions.get(&hash).map(|val| Box::new(val.clone())),
update_versions.get(&hash)
{
Some(Box::new(val.clone()))
} else {
None
},
incompatible: !version.loaders.contains( incompatible: !version.loaders.contains(
&profile &profile