missing closeobs

This commit is contained in:
mr
2026-04-30 14:17:47 +02:00
parent eaa983c92e
commit 276daa4486
3 changed files with 5 additions and 1 deletions

2
go.mod
View File

@@ -3,7 +3,7 @@ module oc-peer
go 1.25.0 go 1.25.0
require ( require (
cloud.o-forge.io/core/oc-lib v0.0.0-20260429050913-47d487ea8011 cloud.o-forge.io/core/oc-lib v0.0.0-20260429095623-9bb3d897b305
github.com/beego/beego/v2 v2.3.8 github.com/beego/beego/v2 v2.3.8
github.com/smartystreets/goconvey v1.7.2 github.com/smartystreets/goconvey v1.7.2
) )

2
go.sum
View File

@@ -56,6 +56,8 @@ cloud.o-forge.io/core/oc-lib v0.0.0-20260423090802-25880077d195 h1:3zgPhZMFcyfeS
cloud.o-forge.io/core/oc-lib v0.0.0-20260423090802-25880077d195/go.mod h1:JynnOb3eMr9VZW1mHq+Vsl3tzx6gPhPsGKpQD/dtEBc= cloud.o-forge.io/core/oc-lib v0.0.0-20260423090802-25880077d195/go.mod h1:JynnOb3eMr9VZW1mHq+Vsl3tzx6gPhPsGKpQD/dtEBc=
cloud.o-forge.io/core/oc-lib v0.0.0-20260429050913-47d487ea8011 h1:owV5pQ+mS5xDCKEcGTO+BgsyYrKjkISL8LDsmjEb/3s= cloud.o-forge.io/core/oc-lib v0.0.0-20260429050913-47d487ea8011 h1:owV5pQ+mS5xDCKEcGTO+BgsyYrKjkISL8LDsmjEb/3s=
cloud.o-forge.io/core/oc-lib v0.0.0-20260429050913-47d487ea8011/go.mod h1:JynnOb3eMr9VZW1mHq+Vsl3tzx6gPhPsGKpQD/dtEBc= cloud.o-forge.io/core/oc-lib v0.0.0-20260429050913-47d487ea8011/go.mod h1:JynnOb3eMr9VZW1mHq+Vsl3tzx6gPhPsGKpQD/dtEBc=
cloud.o-forge.io/core/oc-lib v0.0.0-20260429095623-9bb3d897b305 h1:1A6enYMMjK+2nFd187doD8LOMbnHxl+8EZRf6gqs8Yw=
cloud.o-forge.io/core/oc-lib v0.0.0-20260429095623-9bb3d897b305/go.mod h1:JynnOb3eMr9VZW1mHq+Vsl3tzx6gPhPsGKpQD/dtEBc=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/Knetic/govaluate v3.0.0+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= github.com/Knetic/govaluate v3.0.0+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0=
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=

View File

@@ -109,12 +109,14 @@ func init() {
fmt.Println("ONLINE", msg) fmt.Println("ONLINE", msg)
conn.SetWriteDeadline(time.Now().Add(writeWait)) conn.SetWriteDeadline(time.Now().Add(writeWait))
if conn.WriteJSON(msg) != nil { if conn.WriteJSON(msg) != nil {
infrastructure.CloseObserveSession(connID)
conn.Close() conn.Close()
return return
} }
case <-ticker.C: case <-ticker.C:
conn.SetWriteDeadline(time.Now().Add(writeWait)) conn.SetWriteDeadline(time.Now().Add(writeWait))
if conn.WriteMessage(websocket.PingMessage, nil) != nil { if conn.WriteMessage(websocket.PingMessage, nil) != nil {
infrastructure.CloseObserveSession(connID)
conn.Close() conn.Close()
return return
} }