Skip to content

Commit

Permalink
reorder
Browse files Browse the repository at this point in the history
  • Loading branch information
hatoo committed Jan 8, 2025
1 parent f0cb277 commit 8e35829
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -544,23 +544,20 @@ async fn run() -> anyhow::Result<()> {
}
std::process::exit(libc::EXIT_SUCCESS)
} else if no_tui
&& opts.duration.is_some()
&& opts.duration.is_none()
&& opts.query_per_second.is_none()
&& opts.burst_duration.is_none()
&& !client.is_work_http2()
{
// Use optimized work_until2 for duration only mode.

let duration = opts.duration.unwrap();
let (result_tx, result_rx) = flume::unbounded();

client::work_until2(
client::work2(
client.clone(),
result_tx,
start + duration.into(),
opts.n_requests,
opts.n_connections,
opts.n_http2_parallel,
opts.wait_ongoing_requests_after_deadline,
)
.await;

Expand All @@ -572,20 +569,23 @@ async fn run() -> anyhow::Result<()> {
res
}) as Pin<Box<dyn std::future::Future<Output = ResultData>>>
} else if no_tui
&& opts.duration.is_none()
&& opts.duration.is_some()
&& opts.query_per_second.is_none()
&& opts.burst_duration.is_none()
&& !client.is_work_http2()
{
// Use optimized work_until2 for duration only mode.

let duration = opts.duration.unwrap();
let (result_tx, result_rx) = flume::unbounded();

client::work2(
client::work_until2(
client.clone(),
result_tx,
opts.n_requests,
start + duration.into(),
opts.n_connections,
opts.n_http2_parallel,
opts.wait_ongoing_requests_after_deadline,
)
.await;

Expand Down

0 comments on commit 8e35829

Please sign in to comment.