Skip to content

Commit 9d755c6

Browse files
committed
pool: rename BATCH_EVENT_ITERATION_TIMEOUT to WAIT_FOR_OK_TIMEOUT
Signed-off-by: Yuki Kishimoto <[email protected]>
1 parent e2b0d0f commit 9d755c6

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

crates/nostr-relay-pool/src/relay/constants.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use core::ops::RangeInclusive;
88
use core::time::Duration;
99

10-
pub(super) const BATCH_EVENT_ITERATION_TIMEOUT: Duration = Duration::from_secs(15);
10+
pub(super) const WAIT_FOR_OK_TIMEOUT: Duration = Duration::from_secs(15);
1111
pub(super) const WAIT_FOR_AUTHENTICATION_TIMEOUT: Duration = Duration::from_secs(7);
1212
pub(super) const DEFAULT_CONNECTION_TIMEOUT: Duration = Duration::from_secs(60);
1313

crates/nostr-relay-pool/src/relay/inner.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ use tokio::sync::mpsc::{self, Receiver, Sender};
2323
use tokio::sync::{broadcast, Mutex, MutexGuard, Notify, RwLock};
2424

2525
use super::constants::{
26-
BATCH_EVENT_ITERATION_TIMEOUT, DEFAULT_CONNECTION_TIMEOUT, JITTER_RANGE, MAX_RETRY_INTERVAL,
27-
MIN_ATTEMPTS, MIN_SUCCESS_RATE, NEGENTROPY_BATCH_SIZE_DOWN, NEGENTROPY_FRAME_SIZE_LIMIT,
28-
NEGENTROPY_HIGH_WATER_UP, NEGENTROPY_LOW_WATER_UP, PING_INTERVAL, WEBSOCKET_TX_TIMEOUT,
26+
DEFAULT_CONNECTION_TIMEOUT, JITTER_RANGE, MAX_RETRY_INTERVAL, MIN_ATTEMPTS, MIN_SUCCESS_RATE,
27+
NEGENTROPY_BATCH_SIZE_DOWN, NEGENTROPY_FRAME_SIZE_LIMIT, NEGENTROPY_HIGH_WATER_UP,
28+
NEGENTROPY_LOW_WATER_UP, PING_INTERVAL, WAIT_FOR_OK_TIMEOUT, WEBSOCKET_TX_TIMEOUT,
2929
};
3030
use super::flags::AtomicRelayServiceFlags;
3131
use super::options::{RelayOptions, ReqExitPolicy, SubscribeAutoCloseOptions, SyncOptions};
@@ -1132,7 +1132,7 @@ impl InnerRelay {
11321132
// Wait for OK
11331133
// The event ID is already checked in `wait_for_ok` method
11341134
let (status, message) = self
1135-
.wait_for_ok(&mut notifications, &event.id, BATCH_EVENT_ITERATION_TIMEOUT)
1135+
.wait_for_ok(&mut notifications, &event.id, WAIT_FOR_OK_TIMEOUT)
11361136
.await?;
11371137

11381138
// Check status

crates/nostr-relay-pool/src/relay/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ mod ping;
2626
pub mod stats;
2727
mod status;
2828

29-
use self::constants::{BATCH_EVENT_ITERATION_TIMEOUT, WAIT_FOR_AUTHENTICATION_TIMEOUT};
29+
use self::constants::{WAIT_FOR_AUTHENTICATION_TIMEOUT, WAIT_FOR_OK_TIMEOUT};
3030
pub use self::error::Error;
3131
pub use self::flags::{AtomicRelayServiceFlags, FlagCheck, RelayServiceFlags};
3232
use self::inner::InnerRelay;
@@ -344,7 +344,7 @@ impl Relay {
344344

345345
// Wait for OK
346346
self.inner
347-
.wait_for_ok(notifications, &event.id, BATCH_EVENT_ITERATION_TIMEOUT)
347+
.wait_for_ok(notifications, &event.id, WAIT_FOR_OK_TIMEOUT)
348348
.await
349349
}
350350

0 commit comments

Comments
 (0)