increase write wait

This commit is contained in:
Zack Scholl 2018-09-22 09:31:20 -07:00
parent 2946922fb5
commit b469d5db4b
2 changed files with 4 additions and 1 deletions

View File

@ -10,7 +10,7 @@ import (
const (
// Time allowed to write a message to the peer.
writeWait = 10 * time.Second
writeWait = 6000 * time.Second
// Time allowed to read the next pong message from the peer.
pongWait = 6000 * time.Second

View File

@ -62,6 +62,7 @@ func (h *hub) run() {
for connection := range h.rooms.rooms[s.room] {
close(connection.send)
}
log.Debugf("deleting room %s", s.room)
delete(h.rooms.rooms, s.room)
}
h.rooms.Unlock()
@ -71,6 +72,7 @@ func (h *hub) run() {
for connection := range h.rooms.rooms[s.room] {
close(connection.send)
}
log.Debugf("deleting room %s", s.room)
delete(h.rooms.rooms, s.room)
h.rooms.Unlock()
case m := <-h.broadcast:
@ -86,6 +88,7 @@ func (h *hub) run() {
close(c.send)
delete(connections, c)
if len(connections) == 0 {
log.Debugf("deleting room %s", m.room)
delete(h.rooms.rooms, m.room)
}
}