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));
|
||||
let sig = request::signature(sender, &headers)
|
||||
.expect("activity_pub::broadcast: request signature error");
|
||||
rt.spawn(async move {
|
||||
let client = ClientBuilder::new()
|
||||
.connect_timeout(std::time::Duration::from_secs(5))
|
||||
.build()
|
||||
.expect("Can't build client");
|
||||
rt.spawn(async move {
|
||||
client
|
||||
.post(&inbox)
|
||||
.headers(headers.clone())
|
||||
|
Loading…
Reference in New Issue
Block a user