From e00f1a0410a3f57dea4a0cae1376a5d73609d75b Mon Sep 17 00:00:00 2001 From: Oren Hurvitz Date: Mon, 7 Apr 2014 15:01:06 +0300 Subject: Allow invalidating the users cache --- .../UserAccounts/LocalUserAccountServiceConnector.cs | 10 +++++++++- .../ServiceConnectorsOut/UserAccounts/UserAccountCache.cs | 7 ++++++- 2 files changed, 15 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/LocalUserAccountServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/LocalUserAccountServiceConnector.cs index 529bfd7..6d4ac39 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/LocalUserAccountServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/LocalUserAccountServiceConnector.cs @@ -190,7 +190,15 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts // public bool StoreUserAccount(UserAccount data) { - return UserAccountService.StoreUserAccount(data); + bool ret = UserAccountService.StoreUserAccount(data); + if (ret) + m_Cache.Cache(data.PrincipalID, data); + return ret; + } + + public void InvalidateCache(UUID userID) + { + m_Cache.Invalidate(userID); } #endregion diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/UserAccountCache.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/UserAccountCache.cs index ddef75f..ed52e48 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/UserAccountCache.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/UserAccountCache.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) Contributors, http://opensimulator.org/ * See CONTRIBUTORS.TXT for a full list of copyright holders. * @@ -61,6 +61,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts //m_log.DebugFormat("[USER CACHE]: cached user {0}", userID); } + public void Invalidate(UUID userID) + { + m_UUIDCache.Remove(userID); + } + public UserAccount Get(UUID userID, out bool inCache) { UserAccount account = null; -- cgit v1.1