Skip to content

Commit

Permalink
Don't apply open session delay in client mode
Browse files Browse the repository at this point in the history
  • Loading branch information
OlivierHecart committed Apr 23, 2024
1 parent 9a2a539 commit 1dc6e6c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions zenoh/src/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ use uhlc::HLC;
use zenoh_buffers::ZBuf;
use zenoh_collections::SingleOrVec;
use zenoh_config::unwrap_or_default;
use zenoh_config::WhatAmI;
use zenoh_core::{zconfigurable, zread, Resolve, ResolveClosure, ResolveFuture, SyncResolve};
use zenoh_protocol::core::EntityId;
use zenoh_protocol::network;
Expand Down Expand Up @@ -854,9 +855,11 @@ impl Session {
session.owns_runtime = true;
match runtime.start().await {
Ok(()) => {
// Workaround for the declare_and_shoot problem
tokio::time::sleep(Duration::from_millis(*API_OPEN_SESSION_DELAY))
.await;
if runtime.whatami() != WhatAmI::Client {
// Workaround for the declare_and_shoot problem
tokio::time::sleep(Duration::from_millis(*API_OPEN_SESSION_DELAY))
.await;
}
Ok(session)
}
Err(err) => Err(err),
Expand Down

0 comments on commit 1dc6e6c

Please sign in to comment.