0.1.2: stop retrying vaults that were left or forgotten
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
8
Cargo.lock
generated
8
Cargo.lock
generated
@@ -2581,7 +2581,7 @@ checksum = "f9f8bd3e56ce4dfc153cf470fffbfa98c7620958b312ca5c3a4b8d5181fd13c6"
|
||||
|
||||
[[package]]
|
||||
name = "lune-core"
|
||||
version = "0.1.1"
|
||||
version = "0.1.2"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"base64 0.23.1",
|
||||
@@ -2601,7 +2601,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "lune-desktop"
|
||||
version = "0.1.1"
|
||||
version = "0.1.2"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"chrono",
|
||||
@@ -2621,7 +2621,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "lunehub"
|
||||
version = "0.1.1"
|
||||
version = "0.1.2"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"axum",
|
||||
@@ -2642,7 +2642,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "lunesync"
|
||||
version = "0.1.1"
|
||||
version = "0.1.2"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"chrono",
|
||||
|
||||
@@ -4,4 +4,4 @@ members = ["core", "cli", "hub", "desktop"]
|
||||
|
||||
# One version for every part: the hub offers clients by it (D3).
|
||||
[workspace.package]
|
||||
version = "0.1.1"
|
||||
version = "0.1.2"
|
||||
|
||||
@@ -229,7 +229,7 @@ pub fn leave_hub(config: &mut Config, url: &str, forget: bool) -> Result<Vec<Str
|
||||
}
|
||||
Err(_) => said.push(format!("Couldn't reach {url}, so this device only forgot it; its folders stay, no longer synced")),
|
||||
}
|
||||
for vc in config.vaults.iter().filter(|v| v.hub_url.as_deref() == Some(url)) {
|
||||
for vc in config.vaults.iter().filter(|v| v.hub_url.as_deref() == Some(url) && v.path.exists()) {
|
||||
let _ = set_read_only(&vc.path, false);
|
||||
said.push(format!("{} stays at {}, no longer synced", vc.name, vc.path.display()));
|
||||
}
|
||||
|
||||
@@ -72,8 +72,15 @@ pub fn supervise(log: fn(&str, &str)) -> Result<()> {
|
||||
return;
|
||||
}
|
||||
Err(e) => {
|
||||
// A vault that's no longer in the settings (left, forgotten) isn't retried.
|
||||
if !Config::load().is_ok_and(|c| c.vaults.iter().any(|v| v.path == cfg.path)) {
|
||||
return;
|
||||
}
|
||||
log(&cfg.name, &format!("stopped: {e:#} — retrying in 30 s"));
|
||||
std::thread::sleep(Duration::from_secs(30));
|
||||
if !Config::load().is_ok_and(|c| c.vaults.iter().any(|v| v.path == cfg.path)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user