fix: fix compile error

This commit is contained in:
ICKelin
2021-06-05 14:51:22 +08:00
parent 9dd326c64d
commit c673f0eb68
2 changed files with 5 additions and 10 deletions

View File

@@ -149,7 +149,7 @@ plugin:
准备好配置之后运行以下命令即可开始启动:
`docker run --privileged --net=host -v /opt/logs/opennotr:/opt/resty-upstream/logs -v /opt/data/opennotrd:/opt/conf -d opennotrd`
`docker run --privileged --net=host -v /opt/logs/opennotr:/opt/resty-upstream/logs -v /opt/data/opennotrd:/opt/conf -d ickelin/opennotr:v1.0.4`
需要配置volume将主机目录`/opt/data/opennotrd`挂载到容器的`/opt/conf`当中,`/opt/data/opennotrd`为在上一步当中创建的配置文件,证书目录。

View File

@@ -158,18 +158,13 @@ func (s *Server) onConn(conn net.Conn) {
s.sessMgr.AddSession(vip, sess)
defer s.sessMgr.DeleteSession(vip)
rttInterval := time.NewTicker(time.Second * 10)
for {
select {
case <-mux.CloseChan():
rttInterval := time.NewTicker(time.Millisecond * 500)
for range rttInterval.C {
if mux.IsClosed() {
logs.Info("session %v close", sess.conn.RemoteAddr().String())
return
case <-rttInterval.C:
rtt, _ := mux.Ping()
logs.Debug("session: %s rtt: %4dms",
sess.conn.RemoteAddr().String(), rtt.Milliseconds())
}
}
}