fix: avoid bootstrap bitcoin restarts
This commit is contained in:
parent
2ff47f88a7
commit
be50dc3235
@ -65,7 +65,7 @@ pub async fn ensure_doctor_installed() {
|
|||||||
Err(e) => warn!("Nginx bootstrap failed (non-fatal): {:#}", e),
|
Err(e) => warn!("Nginx bootstrap failed (non-fatal): {:#}", e),
|
||||||
}
|
}
|
||||||
match run_bitcoin_rpc_repair().await {
|
match run_bitcoin_rpc_repair().await {
|
||||||
Ok(true) => info!("Repaired Bitcoin RPC bind settings and restarted Bitcoin containers"),
|
Ok(true) => info!("Repaired Bitcoin RPC bind settings; running Bitcoin containers left untouched"),
|
||||||
Ok(false) => debug!("Bitcoin RPC bind settings already usable"),
|
Ok(false) => debug!("Bitcoin RPC bind settings already usable"),
|
||||||
Err(e) => warn!("Bitcoin RPC repair failed (non-fatal): {:#}", e),
|
Err(e) => warn!("Bitcoin RPC repair failed (non-fatal): {:#}", e),
|
||||||
}
|
}
|
||||||
@ -334,15 +334,11 @@ exit 2
|
|||||||
.context("repair bitcoin.conf RPC bind settings")?;
|
.context("repair bitcoin.conf RPC bind settings")?;
|
||||||
match status.code() {
|
match status.code() {
|
||||||
Some(0) => Ok(false),
|
Some(0) => Ok(false),
|
||||||
Some(2) => {
|
// Do not restart Bitcoin from bootstrap. During IBD, an automatic
|
||||||
for name in ["bitcoin-knots", "bitcoin-core", "archy-bitcoin-ui"] {
|
// restart can cost hours of progress. The repaired file is only a
|
||||||
let _ = tokio::process::Command::new("podman")
|
// fallback for future starts; current containers keep their command-line
|
||||||
.args(["restart", name])
|
// RPC args until an operator or update intentionally restarts them.
|
||||||
.status()
|
Some(2) => Ok(true),
|
||||||
.await;
|
|
||||||
}
|
|
||||||
Ok(true)
|
|
||||||
}
|
|
||||||
_ => {
|
_ => {
|
||||||
warn!("Bitcoin RPC repair helper exited with {}", status);
|
warn!("Bitcoin RPC repair helper exited with {}", status);
|
||||||
Ok(false)
|
Ok(false)
|
||||||
|
|||||||
@ -776,6 +776,14 @@ pub fn spawn_health_monitor(state: Arc<StateManager>, data_dir: PathBuf) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if container.healthy {
|
if container.healthy {
|
||||||
|
let before = data.notifications.len();
|
||||||
|
data.notifications.retain(|n| {
|
||||||
|
n.app_id.as_deref() != Some(&container.app_id)
|
||||||
|
&& !n.title.contains(&container.app_id)
|
||||||
|
});
|
||||||
|
if data.notifications.len() != before {
|
||||||
|
state_changed = true;
|
||||||
|
}
|
||||||
if tracker.attempt_count(&container.name) > 0 {
|
if tracker.attempt_count(&container.name) > 0 {
|
||||||
info!(
|
info!(
|
||||||
"Container {} is healthy again after restart",
|
"Container {} is healthy again after restart",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user