tun2: don't goroutine it up, not fam
This commit is contained in:
parent
46b29ea22d
commit
10f51ef10a
|
@ -158,33 +158,28 @@ func (s *Server) ListenAndServe() error {
|
||||||
s.connlock.Lock()
|
s.connlock.Lock()
|
||||||
|
|
||||||
for _, c := range s.conns {
|
for _, c := range s.conns {
|
||||||
go func() {
|
|
||||||
req, err := http.NewRequest("GET", "http://backend/health", nil)
|
req, err := http.NewRequest("GET", "http://backend/health", nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
ln.Log(c.F(), ln.F{
|
|
||||||
"action": "sending_ping",
|
|
||||||
})
|
|
||||||
|
|
||||||
stream, err := c.session.OpenStream()
|
stream, err := c.session.OpenStream()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ln.Error(err)
|
ln.Error(err, c.F())
|
||||||
|
|
||||||
c.cancel()
|
c.cancel()
|
||||||
}
|
}
|
||||||
|
|
||||||
err = req.Write(stream)
|
err = req.Write(stream)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ln.Error(err)
|
ln.Error(err, c.F())
|
||||||
|
|
||||||
c.cancel()
|
c.cancel()
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err = stream.Read(make([]byte, 30))
|
_, err = stream.Read(make([]byte, 30))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ln.Error(err)
|
ln.Error(err, c.F())
|
||||||
c.cancel()
|
c.cancel()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -193,7 +188,6 @@ func (s *Server) ListenAndServe() error {
|
||||||
ln.Log(ln.F{
|
ln.Log(ln.F{
|
||||||
"action": "ping_health_is_good",
|
"action": "ping_health_is_good",
|
||||||
}, c.F())
|
}, c.F())
|
||||||
}()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
s.connlock.Unlock()
|
s.connlock.Unlock()
|
||||||
|
|
Loading…
Reference in New Issue