Merge pull request #1598 from openziti/fix-api-session-caching

Put api session into tunnel state after looking up from cache. Fixes #1597
This commit is contained in:
Paul Lorenz
2023-08-30 17:23:00 -04:00
committed by GitHub
2 changed files with 4 additions and 2 deletions
@@ -139,6 +139,7 @@ func (self *baseTunnelRequestContext) ensureApiSessionLocking(configTypes []stri
if _, _, err := self.handler.getAppEnv().GetManagers().ApiSession.MarkLastActivityByTokens(self.apiSession.Token); err != nil {
logger.WithError(err).Error("unexpected error while marking api session activity")
}
state.setCurrentApiSessionId(apiSession.Id)
return true
}
}
+3 -2
View File
@@ -239,8 +239,9 @@ func (self *fabricProvider) TunnelService(service tunnel.Service, terminatorInst
}
if response.ApiSession != nil {
log.WithField("apiSessionId", response.ApiSession.SessionId).Info("received new apiSession")
self.updateApiSession(ctrlCh.Id(), response.ApiSession)
if self.updateApiSession(ctrlCh.Id(), response.ApiSession) {
log.WithField("apiSessionId", response.ApiSession.SessionId).Info("received new apiSession")
}
}
if response.Session != nil && response.Session.SessionId != sessionId {