Skip to content

Commit

Permalink
fix: fix multimint dont kill on failed gateway cache update
Browse files Browse the repository at this point in the history
  • Loading branch information
Kodylow committed Sep 20, 2024
1 parent 5366331 commit 4795e86
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 29 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ fm_client_db
.vscode
.DS_Store
fm_db
fm_db_dir
result
/vendor

Expand Down
26 changes: 2 additions & 24 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions fedimint-clientd/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 1 addition & 1 deletion mprocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 8 additions & 2 deletions multimint/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<LightningClientModule>();
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(())
Expand Down

0 comments on commit 4795e86

Please sign in to comment.