Skip to content

Commit cf2af42

Browse files
committed
subd: Make the node and signerproxy less noisy
1 parent 17f0bb4 commit cf2af42

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

libs/gl-plugin/src/node/mod.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ static LIMITER: OnceCell<RateLimiter<NotKeyed, InMemoryState, MonotonicClock>> =
3232
OnceCell::const_new();
3333

3434
static RPC_CLIENT: OnceCell<Arc<Mutex<cln_rpc::ClnRpc>>> = OnceCell::const_new();
35+
static RPC_POLL_INTERVAL: Duration = Duration::from_millis(500);
36+
3537

3638
pub async fn get_rpc<P: AsRef<Path>>(path: P) -> Arc<Mutex<cln_rpc::ClnRpc>> {
3739
RPC_CLIENT
@@ -42,12 +44,9 @@ pub async fn get_rpc<P: AsRef<Path>>(path: P) -> Arc<Mutex<cln_rpc::ClnRpc>> {
4244
debug!("Connected to lightning-rpc.");
4345
return Arc::new(Mutex::new(client));
4446
}
45-
Err(e) => {
46-
debug!(
47-
"Failed to connect to lightning-rpc: {:?}. Retrying in 50m...",
48-
e
49-
);
50-
tokio::time::sleep(Duration::from_millis(50)).await;
47+
Err(_) => {
48+
debug!("Failed to connect to lightning-rpc. Retrying in {RPC_POLL_INTERVAL:?}...");
49+
tokio::time::sleep(RPC_POLL_INTERVAL).await;
5150
continue;
5251
}
5352
}
@@ -369,7 +368,7 @@ impl Node for PluginNodeServer {
369368
req.request.signer_state.len()
370369
);
371370

372-
eprintln!("WIRE: plugin -> signer: {:?}", req);
371+
eprintln!("WIRE: plugin -> signer: {:?}", req);
373372
if let Err(e) = tx.send(Ok(req.request)).await {
374373
warn!("Error streaming request {:?} to hsm_id={}", e, hsm_id);
375374
break;
@@ -394,7 +393,7 @@ impl Node for PluginNodeServer {
394393
log::warn!("The above error was returned instead of a response.");
395394
return Ok(Response::new(pb::Empty::default()));
396395
}
397-
eprintln!("WIRE: signer -> plugin: {:?}", req);
396+
eprintln!("WIRE: signer -> plugin: {:?}", req);
398397

399398
// Create a state from the key-value-version tuples. Need to
400399
// convert here, since `pb` is duplicated in the two different

libs/gl-signerproxy/src/hsmproxy.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use crate::pb::{hsm_client::HsmClient, Empty, HsmRequest, HsmRequestContext};
44
use crate::wire::{DaemonConnection, Message};
55
use anyhow::{anyhow, Context};
66
use anyhow::{Error, Result};
7-
use log::{debug, error, info, warn};
7+
use log::{error, info, warn};
88
use std::convert::TryFrom;
99
use std::env;
1010
use std::os::unix::io::{AsRawFd, FromRawFd};

0 commit comments

Comments
 (0)