Merge pull request #22 from panicbit/21_increase_default_timeout

increase default timeout from 1 to 30 seconds
This commit is contained in:
panicbit 2020-11-18 22:54:46 +01:00 committed by GitHub
commit ddf9c4b9f8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -125,7 +125,7 @@ pub struct Builder<A> {
impl<A: ToSocketAddrs> Builder<A> { impl<A: ToSocketAddrs> Builder<A> {
fn bind(addr: A) -> Self { fn bind(addr: A) -> Self {
Self { addr, timeout: Duration::from_secs(1) } Self { addr, timeout: Duration::from_secs(30) }
} }
/// Set the timeout on incoming requests /// Set the timeout on incoming requests
@ -139,7 +139,7 @@ impl<A: ToSocketAddrs> Builder<A> {
/// If you would like a timeout for your code itself, please use /// If you would like a timeout for your code itself, please use
/// [`tokio::time::Timeout`] to implement it internally. /// [`tokio::time::Timeout`] to implement it internally.
/// ///
/// The default timeout is 1 second. /// The default timeout is 30 seconds.
pub fn set_timeout(mut self, timeout: Duration) -> Self { pub fn set_timeout(mut self, timeout: Duration) -> Self {
self.timeout = timeout; self.timeout = timeout;
self self