move reqwest client out of thread spawning
this way, we only spawn one, and reuse that.
This commit is contained in:
parent
65b2c38c29
commit
be8c67ee9a
@ -152,11 +152,11 @@ where
|
|||||||
headers.insert("Digest", request::Digest::digest(&body));
|
headers.insert("Digest", request::Digest::digest(&body));
|
||||||
let sig = request::signature(sender, &headers)
|
let sig = request::signature(sender, &headers)
|
||||||
.expect("activity_pub::broadcast: request signature error");
|
.expect("activity_pub::broadcast: request signature error");
|
||||||
rt.spawn(async move {
|
|
||||||
let client = ClientBuilder::new()
|
let client = ClientBuilder::new()
|
||||||
.connect_timeout(std::time::Duration::from_secs(5))
|
.connect_timeout(std::time::Duration::from_secs(5))
|
||||||
.build()
|
.build()
|
||||||
.expect("Can't build client");
|
.expect("Can't build client");
|
||||||
|
rt.spawn(async move {
|
||||||
client
|
client
|
||||||
.post(&inbox)
|
.post(&inbox)
|
||||||
.headers(headers.clone())
|
.headers(headers.clone())
|
||||||
|
Loading…
Reference in New Issue
Block a user