Skip to content
This repository has been archived by the owner on Jul 22, 2023. It is now read-only.

Commit

Permalink
Update reqwest to a ClientBuilder, and extend the timeout to 3 minutes (
Browse files Browse the repository at this point in the history
#63)

* Update reqwest to a ClientBuilder, and extend the timeout to 3 minutes

* Fix rustfmt formatting

* Move std imports to the top with a space, undoing rustfmt change

* Move std import into std block

* Cargo fmt (this time with the file stuff correct)
  • Loading branch information
unix-system authored Sep 7, 2021
1 parent ac2c283 commit 942309e
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions src/remodel_api/remodel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use std::{
io::{BufReader, BufWriter, Read},
path::Path,
sync::Arc,
time::Duration,
};

use rbx_dom_weak::{types::VariantType, InstanceBuilder, WeakDom};
Expand Down Expand Up @@ -196,7 +197,11 @@ impl Remodel {
let auth_cookie = re_context.auth_cookie();
let url = format!("https://assetdelivery.roblox.com/v1/asset/?id={}", asset_id);

let client = reqwest::Client::new();
let client = reqwest::Client::builder()
.timeout(Duration::from_secs(60 * 3))
.build()
.map_err(rlua::Error::external)?;

let mut request = client.get(&url);

if let Some(auth_cookie) = auth_cookie {
Expand Down Expand Up @@ -241,7 +246,10 @@ impl Remodel {
let auth_cookie = re_context.auth_cookie();
let url = format!("https://assetdelivery.roblox.com/v1/asset/?id={}", asset_id);

let client = reqwest::Client::new();
let client = reqwest::Client::builder()
.timeout(Duration::from_secs(60 * 3))
.build()
.map_err(rlua::Error::external)?;
let mut request = client.get(&url);

if let Some(auth_cookie) = auth_cookie {
Expand Down Expand Up @@ -340,7 +348,11 @@ impl Remodel {
asset_id
);

let client = reqwest::Client::new();
let client = reqwest::Client::builder()
.timeout(Duration::from_secs(60 * 3))
.build()
.map_err(rlua::Error::external)?;

let build_request = move || {
client
.post(&url)
Expand Down

0 comments on commit 942309e

Please sign in to comment.