Exemplo n.º 1
0
        private BuildSessionManager GetBuildSessionByMac(string mac)
        {
            if (MacToBuildTokenCache.ContainsKey(mac))
            {
                return(BuildSessions[MacToBuildTokenCache[mac]]);
            }

            AccountModel owner = AccountRepo.GetByOwnedPartMac(mac);

            if (owner == null || !UserBuildTokens.ContainsKey(owner.Id))
            {
                return(null);
            }

            string token = UserBuildTokens[owner.Id];

            MacToBuildTokenCache.Add(mac, token);

            return(BuildSessions[token]);
        }