Skip to content

Commit

Permalink
fix: Increase timeouts/event-page-sizes
Browse files Browse the repository at this point in the history
  • Loading branch information
OwshenNetwork committed Jun 18, 2024
1 parent f716098 commit 1f0bcae
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/apis/node/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ pub async fn events(
Query(req): Query<GetEventsRequest>,
context_events: Arc<Mutex<NodeContext>>,
) -> Result<Json<GetEventsResponse>, eyre::Report> {
if req.length > 256 {
return Err(eyre::eyre!("Length must be less than 256"));
if req.length > 32768 {
return Err(eyre::eyre!("Length must be less than 32768"));
}

let context = context_events.lock().await;
Expand Down
8 changes: 4 additions & 4 deletions src/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ impl NodeManager {
let mut elected_peer: Option<Peer> = None;
let mut max_length: u64 = 0;
let client = reqwest::Client::builder()
.timeout(Duration::from_secs(5))
.timeout(Duration::from_secs(10))
.build()?;

for mut peer in self.get_peers() {
Expand Down Expand Up @@ -105,7 +105,7 @@ impl NodeManager {

async fn _add_batch_peer_peers(&mut self, peer: Peer) -> Result<(), eyre::Report> {
let client = reqwest::Client::builder()
.timeout(Duration::from_secs(5))
.timeout(Duration::from_secs(10))
.build()?;

let url = format!("http://{}/get-peers", peer.addr);
Expand Down Expand Up @@ -148,7 +148,7 @@ impl NodeManager {
mut from_sent: usize,
) -> Result<(Vec<SpendFilter>, Vec<SentFilter>, u64), eyre::Report> {
if let Some(elected_peer) = self.elected_peer.clone() {
let step: usize = 256;
let step: usize = 32768;
let mut spend_events = Vec::new();
let mut sent_events = Vec::new();

Expand All @@ -159,7 +159,7 @@ impl NodeManager {
);

let client = reqwest::Client::builder()
.timeout(Duration::from_secs(5))
.timeout(Duration::from_secs(10))
.build()?;
let resp = client.get(&url).send().await;

Expand Down

0 comments on commit 1f0bcae

Please sign in to comment.