fix invalid ptr to shutdown_handler

This commit is contained in:
Xuan Son Nguyen
2025-11-30 15:31:05 +01:00
parent 7b28b5e16a
commit 4a1c05c383
3 changed files with 10 additions and 5 deletions

View File

@@ -276,8 +276,9 @@ int main(int argc, char ** argv, char ** envp) {
// optionally, notify router server that this instance is ready
const char * router_port = std::getenv("LLAMA_SERVER_ROUTER_PORT");
std::thread monitor_thread;
if (router_port != nullptr) {
server_models::setup_child_server(params, std::atoi(router_port), params.model_alias, shutdown_handler);
monitor_thread = server_models::setup_child_server(params, std::atoi(router_port), params.model_alias, shutdown_handler);
}
// this call blocks the main thread until queue_tasks.terminate() is called
@@ -287,6 +288,9 @@ int main(int argc, char ** argv, char ** envp) {
if (ctx_http.thread.joinable()) {
ctx_http.thread.join();
}
if (monitor_thread.joinable()) {
monitor_thread.join();
}
llama_memory_breakdown_print(ctx_server.get_llama_context());
}