Merge pull request #20548 from gustavotrott/avoid-middleware-msg

refactor (gql-middleware): Avoid sending msg GraphqlConnectionClosed when unnecessary
This commit is contained in:
Gustavo Trott 2024-06-19 17:17:25 -03:00 committed by GitHub
commit c49603ff38
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -81,7 +81,10 @@ func ConnectionHandler(w http.ResponseWriter, r *http.Request) {
if bcExists {
sessionTokenRemoved := BrowserConnections[browserConnectionId].SessionToken
delete(BrowserConnections, browserConnectionId)
go SendUserGraphqlConnectionClosedSysMsg(sessionTokenRemoved, browserConnectionId)
if sessionTokenRemoved != "" {
go SendUserGraphqlConnectionClosedSysMsg(sessionTokenRemoved, browserConnectionId)
}
}
BrowserConnectionsMutex.Unlock()