From d06f3755f591259b49d34ec7a2fbaa26c0711a43 Mon Sep 17 00:00:00 2001 From: Sakuhl <2012collector@gmail.com> Date: Sun, 28 Jan 2018 15:56:01 +0100 Subject: [PATCH] Fix timeout issue --- src/commands/mod.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/commands/mod.rs b/src/commands/mod.rs index 620307c..6aed533 100644 --- a/src/commands/mod.rs +++ b/src/commands/mod.rs @@ -110,7 +110,8 @@ Visit the Discord for more help: https://discord.gg/GbN7HeG"))?; pub fn wc_crop(command: &str, msg: &Message) -> Result<(), Error> { let url = &command[5..]; - let new_url = reqwest::get(&format!("https://wynncraft-autocrop.herokuapp.com/crop?url={}", url))?.text().unwrap(); + let client = reqwest::ClientBuilder::new().timeout(::std::time::Duration::from_secs(10000)).build().unwrap(); + let new_url = client.get(&format!("https://wynncraft-autocrop.herokuapp.com/crop?url={}", url)).send()?.text().unwrap(); if new_url.starts_with("https://res.cloudinary.com") { msg.channel_id.say(&new_url)?; } else {