diff options
author | UbitUmarov | 2016-11-19 15:45:41 +0000 |
---|---|---|
committer | UbitUmarov | 2016-11-19 15:45:41 +0000 |
commit | 7cb3d583a97ac36f0c2ef5d6eadae28f26378fc4 (patch) | |
tree | a2ab69bce5eda122b119da082625449f92b4c3d3 /OpenSim/Region/CoreModules | |
parent | Merge branch 'master' into httptests (diff) | |
parent | REST console v2. This is an incompatible protocol change. It degrades gracefu... (diff) | |
download | opensim-SC-7cb3d583a97ac36f0c2ef5d6eadae28f26378fc4.zip opensim-SC-7cb3d583a97ac36f0c2ef5d6eadae28f26378fc4.tar.gz opensim-SC-7cb3d583a97ac36f0c2ef5d6eadae28f26378fc4.tar.bz2 opensim-SC-7cb3d583a97ac36f0c2ef5d6eadae28f26378fc4.tar.xz |
merge conflits
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r-- | OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/UserAccountCache.cs | 33 |
1 files changed, 26 insertions, 7 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/UserAccountCache.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/UserAccountCache.cs index 6c1cc52..2afd74e 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/UserAccountCache.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/UserAccountCache.cs | |||
@@ -36,6 +36,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts | |||
36 | { | 36 | { |
37 | public class UserAccountCache : IUserAccountCacheModule | 37 | public class UserAccountCache : IUserAccountCacheModule |
38 | { | 38 | { |
39 | private const double CACHE_ALIEN_EXPIRATION_SECONDS = 172800; // 48 hours | ||
39 | private const double CACHE_EXPIRATION_SECONDS = 3600.0; // 1 hour! | 40 | private const double CACHE_EXPIRATION_SECONDS = 3600.0; // 1 hour! |
40 | private const double CACHE_NULL_EXPIRATION_SECONDS = 600; // 10minutes | 41 | private const double CACHE_NULL_EXPIRATION_SECONDS = 600; // 10minutes |
41 | 42 | ||
@@ -60,21 +61,20 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts | |||
60 | { | 61 | { |
61 | if (account == null) | 62 | if (account == null) |
62 | m_UUIDCache.AddOrUpdate(userID, null, CACHE_NULL_EXPIRATION_SECONDS); | 63 | m_UUIDCache.AddOrUpdate(userID, null, CACHE_NULL_EXPIRATION_SECONDS); |
63 | else | 64 | else if(account.LocalToGrid) |
64 | { | 65 | { |
65 | m_UUIDCache.AddOrUpdate(userID, account, CACHE_EXPIRATION_SECONDS); | 66 | m_UUIDCache.AddOrUpdate(userID, account, CACHE_EXPIRATION_SECONDS); |
66 | m_NameCache.AddOrUpdate(account.Name, account.PrincipalID, CACHE_EXPIRATION_SECONDS); | 67 | m_NameCache.AddOrUpdate(account.Name, account.PrincipalID, CACHE_EXPIRATION_SECONDS); |
67 | } | 68 | } |
68 | 69 | else | |
70 | { | ||
71 | m_UUIDCache.AddOrUpdate(userID, account, CACHE_ALIEN_EXPIRATION_SECONDS); | ||
72 | m_NameCache.AddOrUpdate(account.Name, account.PrincipalID, CACHE_ALIEN_EXPIRATION_SECONDS); | ||
73 | } | ||
69 | //m_log.DebugFormat("[USER CACHE]: cached user {0}", userID); | 74 | //m_log.DebugFormat("[USER CACHE]: cached user {0}", userID); |
70 | } | 75 | } |
71 | } | 76 | } |
72 | 77 | ||
73 | public void Invalidate(UUID userID) | ||
74 | { | ||
75 | lock(accessLock) | ||
76 | m_UUIDCache.Remove(userID); | ||
77 | } | ||
78 | 78 | ||
79 | public UserAccount Get(UUID userID, out bool inCache) | 79 | public UserAccount Get(UUID userID, out bool inCache) |
80 | { | 80 | { |
@@ -114,6 +114,25 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts | |||
114 | return null; | 114 | return null; |
115 | } | 115 | } |
116 | 116 | ||
117 | public void Invalidate(UUID userID) | ||
118 | { | ||
119 | m_UUIDCache.Remove(userID); | ||
120 | } | ||
121 | |||
122 | public void Remove(UUID id) | ||
123 | { | ||
124 | lock(accessLock) | ||
125 | { | ||
126 | if (!m_UUIDCache.Contains(id)) | ||
127 | return; | ||
128 | |||
129 | UserAccount account = null; | ||
130 | if (m_UUIDCache.TryGetValue(id, out account) && account != null) | ||
131 | m_NameCache.Remove(account.Name); | ||
132 | m_UUIDCache.Remove(id); | ||
133 | } | ||
134 | } | ||
135 | |||
117 | public void Remove(string name) | 136 | public void Remove(string name) |
118 | { | 137 | { |
119 | lock(accessLock) | 138 | lock(accessLock) |