select profile primarily from corresponding session, if exists.

This commit is contained in:
Miroslav Šedivý 2023-01-13 00:15:19 +01:00
parent 2ff8d84ba2
commit 107eba22a5

View File

@ -79,6 +79,12 @@ func (manager *MemberManagerCtx) Select(id string) (types.MemberProfile, error)
manager.providerMu.Lock() manager.providerMu.Lock()
defer manager.providerMu.Unlock() defer manager.providerMu.Unlock()
// get primarily from corresponding session, if exists
session, ok := manager.sessions.Get(id)
if ok {
return session.Profile(), nil
}
return manager.provider.Select(id) return manager.provider.Select(id)
} }