From 8732fee6c59bb209e719a945a66e1e79673e1be1 Mon Sep 17 00:00:00 2001 From: blank X Date: Thu, 17 Jun 2021 22:59:00 +0700 Subject: [PATCH] Add timeout of 60 seconds --- src/github/mod.rs | 1 + src/gitlab/mod.rs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/github/mod.rs b/src/github/mod.rs index cad3955..6b425bc 100644 --- a/src/github/mod.rs +++ b/src/github/mod.rs @@ -27,6 +27,7 @@ pub async fn run(mut args: Skip) { env!("CARGO_PKG_NAME"), env!("CARGO_PKG_VERSION") )) + .timeout(60) .build() .unwrap(); let text = client diff --git a/src/gitlab/mod.rs b/src/gitlab/mod.rs index 7c4185a..7aeb350 100644 --- a/src/gitlab/mod.rs +++ b/src/gitlab/mod.rs @@ -2,7 +2,7 @@ mod structs; use quick_xml::events::{BytesEnd, BytesStart, BytesText, Event}; use quick_xml::{Reader, Writer}; -use reqwest::{Client, Url}; +use reqwest::{ClientBuilder, Url}; use std::borrow::Cow; use std::env; use std::io::Cursor; @@ -17,7 +17,7 @@ pub async fn run(mut args: Skip) { "mr" => structs::MR_QUERY, _ => panic!("Unknown type"), }; - let client = Client::new(); + let client = ClientBuilder::new().timeout(60).build().unwrap(); let text = client .post("https://gitlab.com/api/graphql") .body(