1
0
Fork 0
forked from boyska/circolog

Merge branch 'master' of git.lattuga.net:boyska/circolog

This commit is contained in:
Blallo 2019-05-02 11:45:35 +02:00
commit 6da968177b
2 changed files with 10 additions and 1 deletions

View file

@ -149,7 +149,7 @@ func main() {
select {
case <-done:
log.Println("Successfully close")
case <-time.After(1 * time.Second):
case <-time.After(5 * time.Second):
log.Println("Forced close")
}
return

View file

@ -153,6 +153,15 @@ func getWSHandler(hub circolog.Hub) http.HandlerFunc {
hub.Unregister <- c
conn.Close()
}()
go func() {
for {
_, _, err := conn.ReadMessage()
if err != nil {
conn.Close()
return
}
}
}()
for {
select {
case message, ok := <-c.Messages: