Skip to content

Commit

Permalink
Remove keepalive argument from Torii client and set keep alive to def…
Browse files Browse the repository at this point in the history
…ault 30 secs
  • Loading branch information
edisontim committed Nov 14, 2024
1 parent 51894b3 commit 756027b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
5 changes: 1 addition & 4 deletions crates/torii/client/src/client/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
pub mod error;

use std::sync::Arc;
use std::time::Duration;

use dojo_types::WorldMetadata;
use dojo_world::contracts::WorldContractReader;
Expand Down Expand Up @@ -42,10 +41,8 @@ impl Client {
rpc_url: String,
relay_url: String,
world: Felt,
keepalive: Option<Duration>,
) -> Result<Self, Error> {
let mut grpc_client =
torii_grpc::client::WorldClient::new(torii_url, world, keepalive).await?;
let mut grpc_client = torii_grpc::client::WorldClient::new(torii_url, world).await?;

let relay_client = torii_relay::client::RelayClient::new(relay_url)?;

Expand Down
8 changes: 2 additions & 6 deletions crates/torii/grpc/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,10 @@ pub struct WorldClient {

impl WorldClient {
#[cfg(not(target_arch = "wasm32"))]
pub async fn new(
dst: String,
world_address: Felt,
keepalive: Option<Duration>,
) -> Result<Self, Error> {
pub async fn new(dst: String, world_address: Felt) -> Result<Self, Error> {
let endpoint = Endpoint::from_shared(dst.clone())
.map_err(|e| Error::Endpoint(e.to_string()))?
.tcp_keepalive(keepalive);
.tcp_keepalive(Some(Duration::from_secs(30)));

Check warning on line 56 in crates/torii/grpc/src/client.rs

View check run for this annotation

Codecov / codecov/patch

crates/torii/grpc/src/client.rs#L54-L56

Added lines #L54 - L56 were not covered by tests
let channel = endpoint.connect().await.map_err(Error::Transport)?;
Ok(Self {
_world_address: world_address,
Expand Down

0 comments on commit 756027b

Please sign in to comment.