修复热加载不同配置文件的bug

This commit is contained in:
xiongziliang 2019-05-31 15:49:52 +08:00
parent f5a80e3799
commit f2e4eac5ef

View File

@ -205,7 +205,7 @@ int main(int argc,char *argv[]) {
bool bDaemon = cmd_main.hasKey("daemon"); bool bDaemon = cmd_main.hasKey("daemon");
LogLevel logLevel = (LogLevel) cmd_main["level"].as<int>(); LogLevel logLevel = (LogLevel) cmd_main["level"].as<int>();
logLevel = MIN(MAX(logLevel, LTrace), LError); logLevel = MIN(MAX(logLevel, LTrace), LError);
string ini_file = cmd_main["config"]; static string ini_file = cmd_main["config"];
string ssl_file = cmd_main["ssl"]; string ssl_file = cmd_main["ssl"];
int threads = cmd_main["threads"]; int threads = cmd_main["threads"];
@ -286,7 +286,7 @@ int main(int argc,char *argv[]) {
signal(SIGINT, SIG_IGN);// 设置退出信号 signal(SIGINT, SIG_IGN);// 设置退出信号
sem.post(); sem.post();
});// 设置退出信号 });// 设置退出信号
signal(SIGHUP, [](int) { mediakit::loadIniConfig(); }); signal(SIGHUP, [](int) { mediakit::loadIniConfig(ini_file.data()); });
sem.wait(); sem.wait();
} }
unInstallWebApi(); unInstallWebApi();