commit d97dcb147d79c866f79dd6b76e3ccca7302fe425
parent e08e30f9125b9cf7391e97a2683ba0034bff1644
Author: William Casarin <jb55@jb55.com>
Date: Fri, 10 Jan 2025 06:03:31 -0800
fixed reconnect duration
Changelog-Fixes: Fix long delays when reconnecting
Diffstat:
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/crates/enostr/src/relay/pool.rs b/crates/enostr/src/relay/pool.rs
@@ -237,9 +237,7 @@ impl RelayPool {
relay.last_connect_attempt + relay.retry_connect_after;
if now > reconnect_at {
relay.last_connect_attempt = now;
- let next_duration = Duration::from_millis(
- ((relay.retry_connect_after.as_millis() as f64) * 1.5) as u64,
- );
+ let next_duration = Duration::from_millis(3000);
debug!(
"bumping reconnect duration from {:?} to {:?} and retrying connect",
relay.retry_connect_after, next_duration