Compare commits
1 commit
57871afa68
...
70789fc593
Author | SHA1 | Date | |
---|---|---|---|
70789fc593 |
1 changed files with 2 additions and 7 deletions
|
@ -1,10 +1,10 @@
|
||||||
package websocket
|
package websocket
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
|
||||||
"fmt"
|
|
||||||
"git.smsvc.net/pomodoro/ChronoTomato/internal/notifications"
|
"git.smsvc.net/pomodoro/ChronoTomato/internal/notifications"
|
||||||
"git.smsvc.net/pomodoro/ChronoTomato/internal/shared"
|
"git.smsvc.net/pomodoro/ChronoTomato/internal/shared"
|
||||||
|
"encoding/json"
|
||||||
|
"fmt"
|
||||||
"github.com/charmbracelet/log"
|
"github.com/charmbracelet/log"
|
||||||
"github.com/gorilla/websocket"
|
"github.com/gorilla/websocket"
|
||||||
)
|
)
|
||||||
|
@ -18,11 +18,6 @@ func ProcessServerMessages(conn *websocket.Conn) {
|
||||||
for {
|
for {
|
||||||
_, message, err := conn.ReadMessage()
|
_, message, err := conn.ReadMessage()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if websocket.IsCloseError(err, 1000) {
|
|
||||||
// Ignore normal closure and exit gracefully
|
|
||||||
return
|
|
||||||
}
|
|
||||||
// Log any other errors
|
|
||||||
fmt.Println()
|
fmt.Println()
|
||||||
log.Error("Read error!", "reason", err)
|
log.Error("Read error!", "reason", err)
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in a new issue