--- lbbs/src/net_server.c 2025/06/25 01:50:14 1.66 +++ lbbs/src/net_server.c 2025/06/29 02:28:02 1.69 @@ -25,6 +25,7 @@ #include "login.h" #include "menu.h" #include "net_server.h" +#include "section_list.h" #include "section_list_loader.h" #include #include @@ -406,6 +407,8 @@ int net_server(const char *hostaddr, in_ } sd_notifyf(0, "STATUS=Waiting for %d child process to exit", SYS_child_process_count); + + sleep(1); // Sleep for a while to avoid notifying child processes too frequently } if (SYS_conf_reload && !SYS_server_exit) @@ -426,18 +429,11 @@ int net_server(const char *hostaddr, in_ } else { + unload_menu(&bbs_menu); memcpy(&bbs_menu, &bbs_menu_new, sizeof(bbs_menu_new)); log_common("Reload menu successfully\n"); } - sd_notify(0, "READY=1"); - } - - if (SYS_data_file_reload && !SYS_server_exit) - { - SYS_data_file_reload = 0; - sd_notify(0, "RELOADING=1"); - for (int i = 0; i < data_files_load_startup_count; i++) { if (load_file(data_files_load_startup[i]) < 0) @@ -445,19 +441,19 @@ int net_server(const char *hostaddr, in_ log_error("load_file_mmap(%s) error\n", data_files_load_startup[i]); } } - log_common("Reload data files successfully\n"); - sd_notify(0, "READY=1"); - } - - if (SYS_section_list_reload && !SYS_server_exit) - { - SYS_section_list_reload = 0; - if (section_list_loader_reload() < 0) + // Load section config and gen_ex + if (load_section_config_from_db(1) < 0) + { + log_error("load_section_config_from_db(1) error\n"); + } + else { - log_error("section_list_loader_reload() failed\n"); + log_common("Reload section config and gen_ex successfully\n"); } + + sd_notify(0, "READY=1"); } nfds = epoll_wait(epollfd, events, MAX_EVENTS, 100); // 0.1 second