From 56a79a252c285c68cbdc856dc215d1155dff8c36 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 10 Nov 2016 23:14:08 +0000 Subject: [PATCH] GetUserAccounts cannot cache null accounts --- .../UserAccounts/LocalUserAccountServiceConnector.cs | 9 +++++++-- .../UserAccounts/RemoteUserAccountServiceConnector.cs | 7 +++++-- .../UserAccounts/UserAccountCache.cs | 2 +- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/LocalUserAccountServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/LocalUserAccountServiceConnector.cs index 9325de9854..b72ffbba4a 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/LocalUserAccountServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/LocalUserAccountServiceConnector.cs @@ -211,9 +211,14 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts List ext = UserAccountService.GetUserAccounts(scopeID, missing); if(ext != null && ext.Count > 0) { - ret.AddRange(ext); foreach(UserAccount acc in ext) - m_Cache.Cache(acc.PrincipalID, acc); + { + if(acc != null) + { + ret.Add(acc); + m_Cache.Cache(acc.PrincipalID, acc); + } + } } return ret; } diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/RemoteUserAccountServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/RemoteUserAccountServiceConnector.cs index e84b66630f..f5eda11487 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/RemoteUserAccountServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/RemoteUserAccountServiceConnector.cs @@ -190,8 +190,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts { foreach(UserAccount acc in ext) { - accs.Add(acc); - m_Cache.Cache(acc.PrincipalID, acc); + if(acc != null) + { + accs.Add(acc); + m_Cache.Cache(acc.PrincipalID, acc); + } } } } diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/UserAccountCache.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/UserAccountCache.cs index f514bd77d4..03cb680a0a 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/UserAccountCache.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/UserAccountCache.cs @@ -37,7 +37,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts public class UserAccountCache : IUserAccountCacheModule { private const double CACHE_EXPIRATION_SECONDS = 120000.0; // 33 hours! - private const double CACHENULL_EXPIRATION_SECONDS = 600; // 5minutes + private const double CACHENULL_EXPIRATION_SECONDS = 600; // 10minutes // private static readonly ILog m_log = // LogManager.GetLogger(