Skip to content

Commit

Permalink
Fix: when a file path was given, doesn't listen to any TCP port
Browse files Browse the repository at this point in the history
  • Loading branch information
petertheprocess committed Jul 20, 2024
1 parent ce80955 commit ef3748a
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions crates/top/rerun/src/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -918,20 +918,7 @@ fn run_impl(
};

// Where do we get the data from?
let rx: Vec<Receiver<LogMsg>> = if args.url_or_paths.is_empty() {
#[cfg(feature = "server")]
{
let server_options = re_sdk_comms::ServerOptions {
max_latency_sec: parse_max_latency(args.drop_at_latency.as_ref()),
quiet: false,
};
let rx = re_sdk_comms::serve(&args.bind, args.port, server_options)?;
vec![rx]
}

#[cfg(not(feature = "server"))]
vec![]
} else {
let rx: Vec<Receiver<LogMsg>> = {
let data_sources = args
.url_or_paths
.iter()
Expand All @@ -957,10 +944,23 @@ fn run_impl(
}
}

data_sources
let mut rxs = data_sources
.into_iter()
.map(|data_source| data_source.stream(None))
.collect::<Result<Vec<_>, _>>()?
.collect::<Result<Vec<_>, _>>()?;

#[cfg(feature = "server")]
{
let server_options = re_sdk_comms::ServerOptions {
max_latency_sec: parse_max_latency(args.drop_at_latency.as_ref()),
quiet: false,
};
let tcp_listener: Receiver<LogMsg> =
re_sdk_comms::serve(&args.bind, args.port, server_options)?;
rxs.push(tcp_listener);
}

rxs
};

// Now what do we do with the data?
Expand Down

0 comments on commit ef3748a

Please sign in to comment.