Skip to content

Commit 28ad683

Browse files
author
Timo Freiberg
committed
Fix deadlock
1 parent 1471725 commit 28ad683

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lychee-bin/src/main.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ use std::iter::FromIterator;
6767
use std::{collections::HashSet, fs, str::FromStr};
6868

6969
use anyhow::{anyhow, Context, Result};
70-
use futures::{pin_mut, stream::TryStreamExt};
70+
use futures::stream::TryStreamExt;
7171
use headers::HeaderMapExt;
7272
use indicatif::{ProgressBar, ProgressStyle};
7373
use lychee_lib::{Client, ClientBuilder, Collector, Input, Request, Response};
@@ -271,7 +271,7 @@ async fn run(cfg: &Config, inputs: Vec<Input>) -> Result<i32> {
271271
}
272272
});
273273

274-
pin_mut!(links);
274+
tokio::pin!(links);
275275
while let Some(link) = links.next().await {
276276
let link = link?;
277277
if let Some(pb) = &bar {
@@ -280,6 +280,9 @@ async fn run(cfg: &Config, inputs: Vec<Input>) -> Result<i32> {
280280
};
281281
send_req.send(link).await.unwrap();
282282
}
283+
// required for the receiver task to end, which closes send_resp, which allows
284+
// the show_results_task to finish
285+
drop(send_req);
283286

284287
let (pb, stats) = show_results_task.await?;
285288

0 commit comments

Comments
 (0)