aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorUbitUmarov2016-11-10 19:21:07 +0000
committerUbitUmarov2016-11-10 19:21:07 +0000
commit743a9d617e92f2ccd01816aec3bef73df22ed534 (patch)
treeee550d0d8999caf816cb3dbae702d1e3e27255cf /OpenSim
parenton Select use again the priority queues to send ObjectProperties, including p... (diff)
downloadopensim-SC_OLD-743a9d617e92f2ccd01816aec3bef73df22ed534.zip
opensim-SC_OLD-743a9d617e92f2ccd01816aec3bef73df22ed534.tar.gz
opensim-SC_OLD-743a9d617e92f2ccd01816aec3bef73df22ed534.tar.bz2
opensim-SC_OLD-743a9d617e92f2ccd01816aec3bef73df22ed534.tar.xz
also cache not found useraccounts when search by ID. Change the expire time to 5minutes in this case
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/LocalUserAccountServiceConnector.cs5
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/RemoteUserAccountServiceConnector.cs10
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/UserAccountCache.cs9
3 files changed, 11 insertions, 13 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/LocalUserAccountServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/LocalUserAccountServiceConnector.cs
index a413a8b..9325de9 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/LocalUserAccountServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/LocalUserAccountServiceConnector.cs
@@ -213,10 +213,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts
213 { 213 {
214 ret.AddRange(ext); 214 ret.AddRange(ext);
215 foreach(UserAccount acc in ext) 215 foreach(UserAccount acc in ext)
216 { 216 m_Cache.Cache(acc.PrincipalID, acc);
217 if(acc != null)
218 m_Cache.Cache(acc.PrincipalID, acc);
219 }
220 } 217 }
221 return ret; 218 return ret;
222 } 219 }
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/RemoteUserAccountServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/RemoteUserAccountServiceConnector.cs
index 60dd97a..e84b666 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/RemoteUserAccountServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/RemoteUserAccountServiceConnector.cs
@@ -142,8 +142,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts
142 return account; 142 return account;
143 143
144 account = base.GetUserAccount(scopeID, userID); 144 account = base.GetUserAccount(scopeID, userID);
145 if(account != null) 145 m_Cache.Cache(userID, account);
146 m_Cache.Cache(userID, account);
147 146
148 return account; 147 return account;
149 } 148 }
@@ -191,11 +190,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts
191 { 190 {
192 foreach(UserAccount acc in ext) 191 foreach(UserAccount acc in ext)
193 { 192 {
194 if(acc != null) 193 accs.Add(acc);
195 { 194 m_Cache.Cache(acc.PrincipalID, acc);
196 accs.Add(acc);
197 m_Cache.Cache(acc.PrincipalID, acc);
198 }
199 } 195 }
200 } 196 }
201 } 197 }
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/UserAccountCache.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/UserAccountCache.cs
index 97baf87..f514bd7 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/UserAccountCache.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/UserAccountCache.cs
@@ -37,6 +37,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts
37 public class UserAccountCache : IUserAccountCacheModule 37 public class UserAccountCache : IUserAccountCacheModule
38 { 38 {
39 private const double CACHE_EXPIRATION_SECONDS = 120000.0; // 33 hours! 39 private const double CACHE_EXPIRATION_SECONDS = 120000.0; // 33 hours!
40 private const double CACHENULL_EXPIRATION_SECONDS = 600; // 5minutes
40 41
41// private static readonly ILog m_log = 42// private static readonly ILog m_log =
42// LogManager.GetLogger( 43// LogManager.GetLogger(
@@ -57,9 +58,13 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts
57 // Cache even null accounts 58 // Cache even null accounts
58 lock(accessLock) 59 lock(accessLock)
59 { 60 {
60 m_UUIDCache.AddOrUpdate(userID, account, CACHE_EXPIRATION_SECONDS); 61 if (account == null)
61 if (account != null) 62 m_UUIDCache.AddOrUpdate(userID, null, CACHENULL_EXPIRATION_SECONDS);
63 else
64 {
65 m_UUIDCache.AddOrUpdate(userID, account, CACHE_EXPIRATION_SECONDS);
62 m_NameCache.AddOrUpdate(account.Name, account.PrincipalID, CACHE_EXPIRATION_SECONDS); 66 m_NameCache.AddOrUpdate(account.Name, account.PrincipalID, CACHE_EXPIRATION_SECONDS);
67 }
63 68
64 //m_log.DebugFormat("[USER CACHE]: cached user {0}", userID); 69 //m_log.DebugFormat("[USER CACHE]: cached user {0}", userID);
65 } 70 }