mirror of
https://github.com/eosswedenorg/antelope-api-healthcheck
synced 2026-07-03 11:53:43 +02:00
internal/server/server.go: need to provide a callback to AsyncWrite to close the connection.
This commit is contained in:
parent
5ed22bfdc6
commit
83fd4826d7
1 changed files with 4 additions and 1 deletions
|
|
@ -109,7 +109,10 @@ func (s *Server) OnTraffic(c gnet.Conn) gnet.Action {
|
||||||
|
|
||||||
logger.Info("API Check", params.Combine(healthCheckApi.LogInfo())...)
|
logger.Info("API Check", params.Combine(healthCheckApi.LogInfo())...)
|
||||||
// Report status to HAproxy
|
// Report status to HAproxy
|
||||||
err = c.AsyncWrite([]byte(status.String()), nil)
|
err = c.AsyncWrite([]byte(status.String()), func(c gnet.Conn, err error) error {
|
||||||
|
return c.Close()
|
||||||
|
})
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Error("Write", "message", err)
|
logger.Error("Write", "message", err)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue