Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/bin/semcode-mcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5437,7 +5437,7 @@ async fn main() -> Result<()> {
let git_repo_for_indexing = args.git_repo.clone();
let indexing_state_for_bg = server.indexing_state.clone();
let notification_tx_for_bg = server.notification_tx.clone();
let _indexing_handle = tokio::spawn(async move {
let indexing_handle = tokio::spawn(async move {
// Ensure tables exist before indexing
if let Err(e) = db_for_indexing.create_tables().await {
eprintln!("[Background] Error creating/verifying tables: {}", e);
Expand All @@ -5458,6 +5458,10 @@ async fn main() -> Result<()> {
// Run MCP server on stdio
run_stdio_server(server).await?;

// Gracefully shutdown the background indexing task
indexing_handle.abort();
let _ = indexing_handle.await;

Ok(())
}

Expand Down