Skip to content

Commit 6091550

Browse files
committed
minor fixes
1 parent 6d1c123 commit 6091550

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

examples/server/server.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -665,9 +665,8 @@ int main(int argc, const char ** argv) {
665665
svr->wait_until_ready();
666666
fprintf(stdout, "%s: HTTP server is listening, hostname: %s, port: %d, http threads: %d\n", __func__, args.get_string_param("--host").c_str(), *args.get_int_param("--port"), *args.get_int_param("--n-http-threads"));
667667

668-
// load the model
669-
fprintf(stdout, "%s: loading model and initializing main loop\n", __func__);
670668

669+
pool = new worker_pool;
671670
shutdown_handler = [&](int) {
672671
// this should unblock the primary thread;
673672
terminate(pool);
@@ -688,11 +687,11 @@ int main(int argc, const char ** argv) {
688687
SetConsoleCtrlHandler(reinterpret_cast<PHANDLER_ROUTINE>(console_ctrl_handler), true);
689688
#endif
690689

691-
// It might make sense in the long run to have the primary thread run clean up on the response map and keep the model workers parallel.
692-
pool = new worker_pool;
690+
fprintf(stdout, "%s: loading model and initializing main loop\n", __func__);
691+
// It might make sense in the long run to have the primary thread run clean up on the response map and keep the model workers parallel.
693692
for (int i = *args.get_int_param("--n-parallelism"); i > 0; i--) {
694693
if (i == 1) {
695-
fprintf(stdout, "%s: server is listening on http://%s:%d\n", __func__, args.get_string_param("--host").c_str(), *args.get_int_param("--port"));
694+
fprintf(stdout, "%s: HTTP server is listening on http://%s:%d\n", __func__, args.get_string_param("--host").c_str(), *args.get_int_param("--port"));
696695
worker * w = new worker(tqueue, rmap, args.get_string_param("--text-encoder-path"), *args.get_int_param("--timeout"));
697696
state.store(READY);
698697
pool->push_back(w);
@@ -703,7 +702,7 @@ int main(int argc, const char ** argv) {
703702
pool->push_back(w);
704703
}
705704
}
706-
fprintf(stdout, "HTTP server listening on hostname: %s and port: %d, is shutting down.\n", args.get_string_param("--host").c_str(), *args.get_int_param("--port"));
705+
fprintf(stdout, "%s: HTTP server listening on hostname: %s and port: %d, is shutting down.\n", __func__, args.get_string_param("--host").c_str(), *args.get_int_param("--port"));
707706
svr->stop();
708707
t.join();
709708
rmap->cleanup_thread->join();

0 commit comments

Comments
 (0)