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 76181a7 commit 23bd4d1
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;

Check warning on line 95 in src/cli/tc/start.rs

View check run for this annotation

Codecov / codecov/patch

src/cli/tc/start.rs#L93-L95

Added lines #L93 - L95 were not covered by tests

// 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);
}

Check warning on line 100 in src/cli/tc/start.rs

View check run for this annotation

Codecov / codecov/patch

src/cli/tc/start.rs#L98-L100

Added lines #L98 - L100 were not covered by tests
// wait for the server to shutdown
tokio::time::sleep(Duration::from_millis(500)).await;

Check warning on line 102 in src/cli/tc/start.rs

View check run for this annotation

Codecov / codecov/patch

src/cli/tc/start.rs#L102

Added line #L102 was not covered by tests

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

0 comments on commit 23bd4d1

Please sign in to comment.