This commit is contained in:
Xuan Son Nguyen 2025-11-24 12:20:34 +01:00
parent 6ed192b4dd
commit 2c6b58f785
1 changed files with 2 additions and 3 deletions

View File

@ -5654,7 +5654,7 @@ static server_http_context::handler_t ex_wrapper(server_http_context::handler_t
res->data = safe_json_to_str({{ "error", error_data }}); res->data = safe_json_to_str({{ "error", error_data }});
SRV_WRN("got exception: %s\n", res->data.c_str()); SRV_WRN("got exception: %s\n", res->data.c_str());
} catch (const std::exception & e) { } catch (const std::exception & e) {
SRV_ERR("got another exception: %s | while hanlding exception: %s\n", e.what(), message.c_str()); SRV_ERR("got another exception: %s | while handling exception: %s\n", e.what(), message.c_str());
res->data = "Internal Server Error"; res->data = "Internal Server Error";
} }
return res; return res;
@ -5783,7 +5783,6 @@ int main(int argc, char ** argv, char ** envp) {
if (is_router_server) { if (is_router_server) {
LOG_INF("%s: starting router server, no model will be loaded in this process\n", __func__); LOG_INF("%s: starting router server, no model will be loaded in this process\n", __func__);
ctx_http.is_ready.store(true);
clean_up = [&routes]() { clean_up = [&routes]() {
SRV_INF("%s: cleaning up before exit...\n", __func__); SRV_INF("%s: cleaning up before exit...\n", __func__);
@ -5796,6 +5795,7 @@ int main(int argc, char ** argv, char ** envp) {
LOG_ERR("%s: exiting due to HTTP server error\n", __func__); LOG_ERR("%s: exiting due to HTTP server error\n", __func__);
return 1; return 1;
} }
ctx_http.is_ready.store(true);
shutdown_handler = [&](int) { shutdown_handler = [&](int) {
ctx_http.stop(); ctx_http.stop();
@ -5869,7 +5869,6 @@ int main(int argc, char ** argv, char ** envp) {
if (params.models_allow_extra_args) { if (params.models_allow_extra_args) {
LOG_WRN("%s: extra_args is enabled; this may lead to security issues if the server is exposed to untrusted clients\n", __func__); LOG_WRN("%s: extra_args is enabled; this may lead to security issues if the server is exposed to untrusted clients\n", __func__);
} }
ctx_http.is_ready.store(true);
if (ctx_http.thread.joinable()) { if (ctx_http.thread.joinable()) {
ctx_http.thread.join(); // keep the main thread alive ctx_http.thread.join(); // keep the main thread alive
} }