Allow invalidating the users cache

This commit is contained in:
Oren Hurvitz
2014-04-07 15:01:06 +03:00
parent 86105a1533
commit e00f1a0410
7 changed files with 36 additions and 3 deletions

View File

@@ -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

View File

@@ -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;