mirror of
https://github.com/actix/actix-web.git
synced 2024-11-03 15:39:50 +00:00
fix changes from master
This commit is contained in:
parent
dbb4fab4f7
commit
0aa0f326f7
1 changed files with 5 additions and 4 deletions
|
@ -2,7 +2,7 @@ use std::cell::{RefCell, RefMut, UnsafeCell};
|
||||||
use std::collections::VecDeque;
|
use std::collections::VecDeque;
|
||||||
use std::fmt::Write;
|
use std::fmt::Write;
|
||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
use std::time::Duration;
|
use std::time::{Instant, Duration};
|
||||||
use std::{env, fmt, net};
|
use std::{env, fmt, net};
|
||||||
|
|
||||||
use bytes::BytesMut;
|
use bytes::BytesMut;
|
||||||
|
@ -12,7 +12,7 @@ use http::StatusCode;
|
||||||
use lazycell::LazyCell;
|
use lazycell::LazyCell;
|
||||||
use parking_lot::Mutex;
|
use parking_lot::Mutex;
|
||||||
use time;
|
use time;
|
||||||
use tokio_timer::{sleep, Delay, Interval};
|
use tokio_timer::{sleep, Delay};
|
||||||
use tokio_current_thread::spawn;
|
use tokio_current_thread::spawn;
|
||||||
|
|
||||||
use super::channel::Node;
|
use super::channel::Node;
|
||||||
|
@ -181,9 +181,10 @@ impl<H> WorkerSettings<H> {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn keep_alive_timer(&self) -> Option<Delay> {
|
pub fn keep_alive_timer(&self) -> Option<Delay> {
|
||||||
if self.keep_alive != 0 {
|
let ka = self.0.keep_alive;
|
||||||
|
if ka != 0 {
|
||||||
Some(Delay::new(
|
Some(Delay::new(
|
||||||
Instant::now() + Duration::from_secs(self.keep_alive),
|
Instant::now() + Duration::from_secs(ka),
|
||||||
))
|
))
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
|
|
Loading…
Reference in a new issue