Skip to content

Commit

Permalink
fix: add delay to let server stop
Browse files Browse the repository at this point in the history
Signed-off-by: Sahil Yeole <[email protected]>
  • Loading branch information
beelchester committed Aug 17, 2024
1 parent 1233dea commit 4b9dd5f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/cli/tc/start.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,12 @@ async fn watch_files(
if now.duration_since(last_event_time) >= debounce_duration {
last_event_time = now;

// send the signal to the currently running server runtime to shutdown
if let Err(err) = tx.send(()) {
tracing::error!("Failed to send the signal: {}", err);
tracing::error!("Failed to stop the server: {}", err);
}
// wait for the server to shutdown
tokio::time::sleep(Duration::from_millis(500)).await;

if let Err(e) = handle_server(
&mut rx,
Expand Down

0 comments on commit 4b9dd5f

Please sign in to comment.