mirror of
https://github.com/fiatjaf/khatru.git
synced 2025-03-26 17:51:49 +01:00
fix "error writing ping" warnings.
This commit is contained in:
parent
a63b805898
commit
e7286f0658
@ -39,10 +39,12 @@ func handleWebsocket(relay Relay) func(http.ResponseWriter, *http.Request) {
|
||||
log.Warn().Err(err).Msg("failed to upgrade websocket")
|
||||
return
|
||||
}
|
||||
ticker := time.NewTicker(pingPeriod)
|
||||
|
||||
// reader
|
||||
go func() {
|
||||
defer func() {
|
||||
ticker.Stop()
|
||||
conn.Close()
|
||||
}()
|
||||
|
||||
@ -170,7 +172,6 @@ func handleWebsocket(relay Relay) func(http.ResponseWriter, *http.Request) {
|
||||
|
||||
// writer
|
||||
go func() {
|
||||
ticker := time.NewTicker(pingPeriod)
|
||||
defer func() {
|
||||
ticker.Stop()
|
||||
conn.Close()
|
||||
|
Loading…
x
Reference in New Issue
Block a user