From 0fdc9d0f05b5e51587383106d3691961243321ba Mon Sep 17 00:00:00 2001 From: Kyle Kelley Date: Fri, 16 Aug 2024 15:50:19 -0500 Subject: [PATCH] context_servers: Log errors from detached context server tasks (#16377) Logged several of the detached tasks that before would silently fail if the context server wasn't in compliance. Release Notes: - N/A --- crates/context_servers/src/context_servers.rs | 4 +++- crates/context_servers/src/manager.rs | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/crates/context_servers/src/context_servers.rs b/crates/context_servers/src/context_servers.rs index 3892adff56..0dd58de0c8 100644 --- a/crates/context_servers/src/context_servers.rs +++ b/crates/context_servers/src/context_servers.rs @@ -30,7 +30,9 @@ fn restart_servers(_workspace: &mut Workspace, _action: &Restart, cx: &mut ViewC let model = ContextServerManager::global(&cx); cx.update_model(&model, |manager, cx| { for server in manager.servers() { - manager.restart_server(&server.id, cx).detach(); + manager + .restart_server(&server.id, cx) + .detach_and_log_err(cx); } }); } diff --git a/crates/context_servers/src/manager.rs b/crates/context_servers/src/manager.rs index 9d7d67a72f..30164cd5c4 100644 --- a/crates/context_servers/src/manager.rs +++ b/crates/context_servers/src/manager.rs @@ -266,11 +266,11 @@ pub fn init(cx: &mut AppContext) { log::trace!("servers_to_add={:?}", servers_to_add); for config in servers_to_add { - manager.add_server(config, cx).detach(); + manager.add_server(config, cx).detach_and_log_err(cx); } for id in servers_to_remove { - manager.remove_server(&id, cx).detach(); + manager.remove_server(&id, cx).detach_and_log_err(cx); } }) })