mirror of https://github.com/fafhrd91/actix-net
stop workers in forced shutdown
This commit is contained in:
parent
e0fa4c3ef1
commit
a61290f564
|
@ -245,13 +245,15 @@ impl ServerInner {
|
|||
// stop accept thread
|
||||
self.waker_queue.wake(WakerInterest::Stop);
|
||||
|
||||
// send stop signal to workers
|
||||
let workers_stop = self
|
||||
.worker_handles
|
||||
.iter()
|
||||
.map(|worker| worker.stop(graceful))
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
if graceful {
|
||||
// wait for all workers to shut down
|
||||
let workers_stop = self
|
||||
.worker_handles
|
||||
.iter()
|
||||
.map(|worker| worker.stop(graceful))
|
||||
.collect::<Vec<_>>();
|
||||
let _ = join_all(workers_stop).await;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue