From 4795e86e3dcb3b9863c657835d9428f3c45fc029 Mon Sep 17 00:00:00 2001 From: "kody.low" Date: Fri, 20 Sep 2024 16:31:07 -0400 Subject: [PATCH] fix: fix multimint dont kill on failed gateway cache update --- .gitignore | 1 + Cargo.lock | 26 ++------------------------ fedimint-clientd/Cargo.toml | 4 ++-- mprocs.yaml | 2 +- multimint/src/lib.rs | 10 ++++++++-- 5 files changed, 14 insertions(+), 29 deletions(-) diff --git a/.gitignore b/.gitignore index e6b7f0d..8cf6843 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ fm_client_db .vscode .DS_Store fm_db +fm_db_dir result /vendor diff --git a/Cargo.lock b/Cargo.lock index aa2e974..a6880aa 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1410,7 +1410,7 @@ dependencies = [ "lazy_static", "lightning-invoice", "lnurl-rs", - "multimint 0.3.6", + "multimint", "reqwest 0.12.4", "serde", "serde_json", @@ -1664,7 +1664,7 @@ dependencies = [ "image", "itertools 0.13.0", "lightning-invoice", - "multimint 0.3.7", + "multimint", "nostr", "nostr-sdk", "qrcode", @@ -3001,28 +3001,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "multimint" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9989e73f689a15421660f72b902165b5e4579d1cb0d2f208108ea374b0bbf2d7" -dependencies = [ - "anyhow", - "fedimint-client", - "fedimint-core", - "fedimint-ln-client", - "fedimint-mint-client", - "fedimint-rocksdb", - "fedimint-wallet-client", - "futures-util", - "hex", - "rand", - "serde", - "serde_json", - "tokio", - "tracing", -] - [[package]] name = "multimint" version = "0.3.7" diff --git a/fedimint-clientd/Cargo.toml b/fedimint-clientd/Cargo.toml index e66f458..6917f0a 100644 --- a/fedimint-clientd/Cargo.toml +++ b/fedimint-clientd/Cargo.toml @@ -37,7 +37,7 @@ time = { version = "0.3.25", features = ["formatting"] } chrono = "0.4.31" futures-util = "0.3.30" clap = { version = "3", features = ["derive", "env"] } -multimint = { version = "0.3.6" } -# multimint = { path = "../multimint" } +# multimint = { version = "0.3.6" } +multimint = { path = "../multimint" } axum-otel-metrics = "0.8.0" hex = "0.4.3" diff --git a/mprocs.yaml b/mprocs.yaml index b17659a..4487bad 100644 --- a/mprocs.yaml +++ b/mprocs.yaml @@ -4,7 +4,7 @@ procs: # shell: bash # if on Linux stop: SIGKILL fedimint-clientd: - shell: cargo run --manifest-path fedimint-clientd/Cargo.toml + shell: export RUST_BACKTRACE=1 && cargo run --manifest-path fedimint-clientd/Cargo.toml stop: SIGTERM ngrok: shell: ngrok http http://localhost:3333 diff --git a/multimint/src/lib.rs b/multimint/src/lib.rs index 4b8d986..34c80d1 100644 --- a/multimint/src/lib.rs +++ b/multimint/src/lib.rs @@ -371,9 +371,15 @@ impl MultiMint { pub async fn update_gateway_caches(&self) -> Result<()> { let clients = self.clients.lock().await; - for (_, client) in clients.iter() { + for (federation_id, client) in clients.iter() { + warn!("Updating gateway cache for {:?}", federation_id); let lightning_client = client.get_first_module::(); - lightning_client.update_gateway_cache().await?; + if let Err(e) = lightning_client.update_gateway_cache().await { + warn!( + "Failed to update gateway cache for {:?}: {:?}", + federation_id, e + ); + } } Ok(())