File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ async fn main() -> Result<(), Box<dyn Error + Send + Sync>> {
65
65
None
66
66
} ;
67
67
68
- let server_task = tokio:: spawn ( run_swim_server ( addr_tx, bind_to) ) ;
68
+ let server_task = tokio:: spawn ( run_swim_server ( addr_tx, shutdown_tx , bind_to) ) ;
69
69
70
70
if include_ui {
71
71
let ui_task = tokio:: spawn ( ui_server ( addr_rx, shutdown_rx, SHUTDOWN_TIMEOUT , ui_port) ) ;
@@ -109,6 +109,7 @@ fn configure_logging() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
109
109
110
110
async fn run_swim_server (
111
111
bound : oneshot:: Sender < SocketAddr > ,
112
+ shutdown_tx : Arc < Notify > ,
112
113
bind_to : Option < SocketAddr > ,
113
114
) -> Result < ( ) , Box < dyn Error + Send + Sync > > {
114
115
let mut builder = ServerBuilder :: with_plane_name ( "Game Plane" ) ;
@@ -131,6 +132,8 @@ async fn run_swim_server(
131
132
132
133
let ( _, result) = futures:: future:: join ( shutdown, task) . await ;
133
134
135
+ shutdown_tx. notify_one ( ) ;
136
+
134
137
result?;
135
138
info ! ( "Server stopped successfully." ) ;
136
139
Ok ( ( ) )
You can’t perform that action at this time.
0 commit comments