File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -368,6 +368,12 @@ impl Default for WorkerState {
368
368
}
369
369
}
370
370
371
+ impl Drop for ServerWorker {
372
+ fn drop ( & mut self ) {
373
+ Arbiter :: current ( ) . stop ( ) ;
374
+ }
375
+ }
376
+
371
377
impl Future for ServerWorker {
372
378
type Output = ( ) ;
373
379
@@ -451,14 +457,12 @@ impl Future for ServerWorker {
451
457
if let WorkerState :: Shutdown ( shutdown) = mem:: take ( & mut this. state ) {
452
458
let _ = shutdown. tx . send ( true ) ;
453
459
}
454
- Arbiter :: current ( ) . stop ( ) ;
455
460
Poll :: Ready ( ( ) )
456
461
} else if shutdown. start_from . elapsed ( ) >= this. shutdown_timeout {
457
462
// Timeout forceful shutdown.
458
463
if let WorkerState :: Shutdown ( shutdown) = mem:: take ( & mut this. state ) {
459
464
let _ = shutdown. tx . send ( false ) ;
460
465
}
461
- Arbiter :: current ( ) . stop ( ) ;
462
466
Poll :: Ready ( ( ) )
463
467
} else {
464
468
// Reset timer and wait for 1 second.
You can’t perform that action at this time.
0 commit comments