also cache not found useraccounts when search by ID. Change the expire time to 5minutes in this case
parent
bddaef5122
commit
743a9d617e
|
@ -213,10 +213,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts
|
||||||
{
|
{
|
||||||
ret.AddRange(ext);
|
ret.AddRange(ext);
|
||||||
foreach(UserAccount acc in ext)
|
foreach(UserAccount acc in ext)
|
||||||
{
|
m_Cache.Cache(acc.PrincipalID, acc);
|
||||||
if(acc != null)
|
|
||||||
m_Cache.Cache(acc.PrincipalID, acc);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -142,8 +142,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts
|
||||||
return account;
|
return account;
|
||||||
|
|
||||||
account = base.GetUserAccount(scopeID, userID);
|
account = base.GetUserAccount(scopeID, userID);
|
||||||
if(account != null)
|
m_Cache.Cache(userID, account);
|
||||||
m_Cache.Cache(userID, account);
|
|
||||||
|
|
||||||
return account;
|
return account;
|
||||||
}
|
}
|
||||||
|
@ -191,11 +190,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts
|
||||||
{
|
{
|
||||||
foreach(UserAccount acc in ext)
|
foreach(UserAccount acc in ext)
|
||||||
{
|
{
|
||||||
if(acc != null)
|
accs.Add(acc);
|
||||||
{
|
m_Cache.Cache(acc.PrincipalID, acc);
|
||||||
accs.Add(acc);
|
|
||||||
m_Cache.Cache(acc.PrincipalID, acc);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,6 +37,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts
|
||||||
public class UserAccountCache : IUserAccountCacheModule
|
public class UserAccountCache : IUserAccountCacheModule
|
||||||
{
|
{
|
||||||
private const double CACHE_EXPIRATION_SECONDS = 120000.0; // 33 hours!
|
private const double CACHE_EXPIRATION_SECONDS = 120000.0; // 33 hours!
|
||||||
|
private const double CACHENULL_EXPIRATION_SECONDS = 600; // 5minutes
|
||||||
|
|
||||||
// private static readonly ILog m_log =
|
// private static readonly ILog m_log =
|
||||||
// LogManager.GetLogger(
|
// LogManager.GetLogger(
|
||||||
|
@ -57,9 +58,13 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts
|
||||||
// Cache even null accounts
|
// Cache even null accounts
|
||||||
lock(accessLock)
|
lock(accessLock)
|
||||||
{
|
{
|
||||||
m_UUIDCache.AddOrUpdate(userID, account, CACHE_EXPIRATION_SECONDS);
|
if (account == null)
|
||||||
if (account != null)
|
m_UUIDCache.AddOrUpdate(userID, null, CACHENULL_EXPIRATION_SECONDS);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_UUIDCache.AddOrUpdate(userID, account, CACHE_EXPIRATION_SECONDS);
|
||||||
m_NameCache.AddOrUpdate(account.Name, account.PrincipalID, CACHE_EXPIRATION_SECONDS);
|
m_NameCache.AddOrUpdate(account.Name, account.PrincipalID, CACHE_EXPIRATION_SECONDS);
|
||||||
|
}
|
||||||
|
|
||||||
//m_log.DebugFormat("[USER CACHE]: cached user {0}", userID);
|
//m_log.DebugFormat("[USER CACHE]: cached user {0}", userID);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue