添加on_server_exited webhook事件,当程序正常退出时触发 (#2591 #2585)

This commit is contained in:
pedoc
2023-06-28 11:36:41 +08:00
committed by GitHub
parent c530f281c3
commit 2771bc15a5
4 changed files with 25 additions and 2 deletions

View File

@@ -409,9 +409,9 @@ int start_main(int argc,char *argv[]) {
static semaphore sem;
signal(SIGINT, [](int) {
InfoL << "SIGINT:exit";
signal(SIGINT, SIG_IGN);// 设置退出信号
signal(SIGINT, SIG_IGN); // 设置退出信号
sem.post();
});// 设置退出信号
}); // 设置退出信号
#if !defined(_WIN32)
signal(SIGHUP, [](int) { mediakit::loadIniConfig(g_ini_file.data()); });
@@ -420,6 +420,8 @@ int start_main(int argc,char *argv[]) {
}
unInstallWebApi();
unInstallWebHook();
onProcessExited();
//休眠1秒再退出防止资源释放顺序错误
InfoL << "程序退出中,请等待...";
sleep(1);