Skip to content

Commit 1ad03f6

Browse files
author
Chris Mason
committed
Merge remote-tracking branch 'semcode/pr/13'
Merge in Sasha's shutdown fix Signed-off-by: Chris Mason <clm@fb.com>
2 parents 7b1532a + d577c8a commit 1ad03f6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/bin/semcode-mcp.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5649,7 +5649,7 @@ async fn main() -> Result<()> {
56495649
let git_repo_for_indexing = args.git_repo.clone();
56505650
let indexing_state_for_bg = server.indexing_state.clone();
56515651
let notification_tx_for_bg = server.notification_tx.clone();
5652-
let _indexing_handle = tokio::spawn(async move {
5652+
let indexing_handle = tokio::spawn(async move {
56535653
// Ensure tables exist before indexing
56545654
if let Err(e) = db_for_indexing.create_tables().await {
56555655
eprintln!("[Background] Error creating/verifying tables: {}", e);
@@ -5670,6 +5670,10 @@ async fn main() -> Result<()> {
56705670
// Run MCP server on stdio
56715671
run_stdio_server(server).await?;
56725672

5673+
// Gracefully shutdown the background indexing task
5674+
indexing_handle.abort();
5675+
let _ = indexing_handle.await;
5676+
56735677
Ok(())
56745678
}
56755679

0 commit comments

Comments
 (0)