Skip to content

Commit a7b6f64

Browse files
authored
upd ui (#105)
1 parent b6c3833 commit a7b6f64

3 files changed

Lines changed: 12 additions & 3 deletions

File tree

api/websocket_handler.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,17 @@ func (h *APIHandler) HandleWebSocket(w http.ResponseWriter, r *http.Request) {
151151
}()
152152

153153
for {
154+
154155
_, msg, err := conn.ReadMessage()
155156
if err != nil {
157+
if websocket.IsCloseError(err, websocket.CloseNormalClosure) {
158+
fmt.Println("Client closed connection")
159+
break
160+
} else if websocket.IsUnexpectedCloseError(err, websocket.CloseNormalClosure) {
161+
fmt.Println("Client closed connection unexpectedly")
162+
break
163+
}
164+
156165
fmt.Println("Error reading message:", err)
157166
break
158167
}

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ require (
1717
)
1818

1919
require (
20-
github.com/erigontech/erigonwatch v0.1.24
20+
github.com/erigontech/erigonwatch v0.1.25
2121
github.com/fsnotify/fsnotify v1.7.0 // indirect
2222
github.com/hashicorp/hcl v1.0.0 // indirect
2323
github.com/inconshreveable/mousetrap v1.1.0 // indirect

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
33
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
44
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
55
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
6-
github.com/erigontech/erigonwatch v0.1.24 h1:o0Smm0IUg8Ak8sfo0BKht/jos8N9ht8wwqXJ13F5H0k=
7-
github.com/erigontech/erigonwatch v0.1.24/go.mod h1:8vQ+VjvLu2gkPs8EwdPrOTAAo++WuLuBi54N7NuAF0I=
6+
github.com/erigontech/erigonwatch v0.1.25 h1:NRCwI6Np4XHVoL/vfPoFH9cphqIAAtWkXArN+is5Cjs=
7+
github.com/erigontech/erigonwatch v0.1.25/go.mod h1:8vQ+VjvLu2gkPs8EwdPrOTAAo++WuLuBi54N7NuAF0I=
88
github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8=
99
github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
1010
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=

0 commit comments

Comments
 (0)