File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ pub struct AsyncConnection {
8787impl AsyncConnection {
8888 /// Creates a new `AsyncConnection`.
8989 pub ( crate ) fn new ( request : ParsedRequest ) -> AsyncConnection {
90- let timeout = request. config . timeout . or_else ( || match env:: var ( "MINREQ_TIMEOUT " ) {
90+ let timeout = request. config . timeout . or_else ( || match env:: var ( "BITREQ_TIMEOUT " ) {
9191 Ok ( t) => t. parse :: < u64 > ( ) . ok ( ) ,
9292 Err ( _) => None ,
9393 } ) ;
@@ -128,7 +128,7 @@ impl Connection {
128128 /// Creates a new `Connection`. See [Request] and [ParsedRequest]
129129 /// for specifics about *what* is being sent.
130130 pub ( crate ) fn new ( request : ParsedRequest ) -> Connection {
131- let timeout = request. config . timeout . or_else ( || match env:: var ( "MINREQ_TIMEOUT " ) {
131+ let timeout = request. config . timeout . or_else ( || match env:: var ( "BITREQ_TIMEOUT " ) {
132132 Ok ( t) => t. parse :: < u64 > ( ) . ok ( ) ,
133133 Err ( _) => None ,
134134 } ) ;
Original file line number Diff line number Diff line change 207207//! ```text,ignore
208208//! bitreq::get("/").with_timeout(8).send();
209209//! ```
210- //! - Set the environment variable `MINREQ_TIMEOUT ` to the desired
210+ //! - Set the environment variable `BITREQ_TIMEOUT ` to the desired
211211//! amount of seconds until timeout. Ie. if you have a program called
212212//! `foo` that uses bitreq, and you want all the requests made by that
213213//! program to timeout in 8 seconds, you launch the program like so:
214214//! ```text,ignore
215- //! $ MINREQ_TIMEOUT =8 ./foo
215+ //! $ BITREQ_TIMEOUT =8 ./foo
216216//! ```
217217//! Or add the following somewhere before the requests in the code.
218218//! ```
219- //! std::env::set_var("MINREQ_TIMEOUT ", "8");
219+ //! std::env::set_var("BITREQ_TIMEOUT ", "8");
220220//! ```
221221//! If the timeout is set with `with_timeout`, the environment
222222//! variable will be ignored.
You can’t perform that action at this time.
0 commit comments