nostr-rs-relay

My dev fork of nostr-rs-relay
git clone git://jb55.com/nostr-rs-relay
Log | Files | Refs | README | LICENSE

commit 11e43eccf9d8765355b78d9e2dbe49dd952ca148
parent 50577b2dfa1d3f9f4b4ed9ada015a9351545e3d5
Author: Greg Heartsfield <scsibug@imap.cc>
Date:   Sat,  5 Nov 2022 07:42:08 -0500

refactor: add unit to ping_interval config

Diffstat:
Msrc/config.rs | 4++--
Msrc/server.rs | 2+-
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/config.rs b/src/config.rs @@ -29,7 +29,7 @@ pub struct Network { pub port: u16, pub address: String, pub remote_ip_header: Option<String>, // retrieve client IP from this HTTP header if present - pub ping_interval: u32, + pub ping_interval_seconds: u32, } #[derive(Debug, Clone, Serialize, Deserialize)] @@ -208,7 +208,7 @@ impl Default for Settings { }, network: Network { port: 8080, - ping_interval: 300, + ping_interval_seconds: 300, address: "0.0.0.0".to_owned(), remote_ip_header: None, }, diff --git a/src/server.rs b/src/server.rs @@ -427,7 +427,7 @@ async fn nostr_server( let mut last_message_time = Instant::now(); // ping interval (every 5 minutes) - let default_ping_dur = Duration::from_secs(settings.network.ping_interval.into()); + let default_ping_dur = Duration::from_secs(settings.network.ping_interval_seconds.into()); // disconnect after 20 minutes without a ping response or event. let max_quiet_time = Duration::from_secs(60 * 20);