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
This commit is contained in:
Kyle Kelley 2024-08-16 15:50:19 -05:00 committed by GitHub
parent 907d76208d
commit 0fdc9d0f05
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 3 deletions

View File

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

View File

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