[fix] windows undefined syscall.Kill, use logic.Dispose in pkg innertest directly

pull/29/head
q191201771 4 years ago
parent b867ad963a
commit 80e4a83067

@ -14,7 +14,6 @@ import (
"io"
"io/ioutil"
"os"
"syscall"
"testing"
"time"
@ -158,7 +157,9 @@ func InnerTestEntry(t *testing.T) {
rtmpPullSession.Dispose()
httpFLVWriter.Dispose()
rtmpWriter.Dispose()
_ = syscall.Kill(syscall.Getpid(), syscall.SIGUSR1)
// 由于windows没有信号会导致编译错误所以直接调用Dispose
//_ = syscall.Kill(syscall.Getpid(), syscall.SIGUSR1)
logic.Dispose()
nazalog.Debugf("count. %d %d %d", fileTagCount.Load(), httpflvPullTagCount.Load(), rtmpPullTagCount.Load())
compareFile()

@ -22,6 +22,7 @@ import (
var (
config *Config
sm *ServerManager
)
func Entry(confFile string) {
@ -30,7 +31,7 @@ func Entry(confFile string) {
nazalog.Infof("bininfo: %s", bininfo.StringifySingleLine())
nazalog.Infof("version: %s", base.LALFullInfo)
sm := NewServerManager()
sm = NewServerManager()
if config.PProfConfig.Enable {
go runWebPProf(config.PProfConfig.Addr)
@ -42,6 +43,10 @@ func Entry(confFile string) {
sm.RunLoop()
}
func Dispose() {
sm.Dispose()
}
func loadConf(confFile string) *Config {
config, err := LoadConf(confFile)
if err != nil {

Loading…
Cancel
Save