Fix a bug when user get Presenter
This commit is contained in:
parent
8f7c23e175
commit
d7f92f918c
@ -48,7 +48,7 @@ func HasuraConnectionReader(hc *common.HasuraConnection, fromHasuraToBrowserChan
|
||||
hc.Browserconn.ActiveSubscriptionsMutex.RUnlock()
|
||||
if !ok {
|
||||
log.Debugf("Subscription with Id %s doesn't exist anymore, skiping response.", queryId)
|
||||
return
|
||||
continue
|
||||
}
|
||||
|
||||
//When Hasura send msg type "complete", this query is finished
|
||||
|
@ -136,16 +136,17 @@ func InvalidateSessionTokenConnections(sessionTokenToInvalidate string) {
|
||||
for _, browserConnection := range BrowserConnections {
|
||||
if browserConnection.SessionToken == sessionTokenToInvalidate {
|
||||
if browserConnection.HasuraConnection != nil {
|
||||
|
||||
// Wait until there are no active mutations
|
||||
for iterationCount := 0; iterationCount < 100; iterationCount++ {
|
||||
for iterationCount := 0; iterationCount < 20; iterationCount++ {
|
||||
activeMutationFound := false
|
||||
browserConnection.ActiveSubscriptionsMutex.RLock()
|
||||
for _, subscription := range browserConnection.ActiveSubscriptions {
|
||||
if subscription.Type == common.Mutation {
|
||||
activeMutationFound = true
|
||||
break
|
||||
}
|
||||
}
|
||||
browserConnection.ActiveSubscriptionsMutex.RUnlock()
|
||||
if !activeMutationFound {
|
||||
break
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user