Only log websocket error if not a close message
This commit is contained in:
parent
05501ba79e
commit
d9d6cdca6d
1 changed files with 4 additions and 0 deletions
|
@ -23,6 +23,7 @@ import (
|
||||||
"github.com/abcum/surreal/db"
|
"github.com/abcum/surreal/db"
|
||||||
"github.com/abcum/surreal/sql"
|
"github.com/abcum/surreal/sql"
|
||||||
"github.com/abcum/surreal/util/show"
|
"github.com/abcum/surreal/util/show"
|
||||||
|
"github.com/gorilla/websocket"
|
||||||
)
|
)
|
||||||
|
|
||||||
func limit(c *fibre.Context, i int64) int64 {
|
func limit(c *fibre.Context, i int64) int64 {
|
||||||
|
@ -165,6 +166,9 @@ func routes(s *fibre.Fibre) {
|
||||||
for {
|
for {
|
||||||
_, msg, err := c.Socket().Read()
|
_, msg, err := c.Socket().Read()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if websocket.IsCloseError(err, 1000, 1001, 1005) {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if res, err := db.Execute(c, msg, nil); err != nil {
|
if res, err := db.Execute(c, msg, nil); err != nil {
|
||||||
|
|
Loading…
Reference in a new issue