Avoid repeated lag-generating continuous attempts to retrieve HG service Urls in UMM if the initial request fails, possibly due to the home URL not being present

Instead, the failure information is effectively added to the memory cache (so no persistence over simualtor sessions).
A future improvement may be to invalidate negative cache results after some time has passed in case the failure was transient.
Looks to resolve http://opensimulator.org/mantis/view.php?id=7382
mb-throttle-test
Justin Clark-Casey (justincc) 2014-11-28 01:16:30 +00:00
parent d9f7aa41c1
commit 09534f378e
1 changed files with 11 additions and 7 deletions

View File

@ -462,12 +462,14 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
{ {
// m_log.DebugFormat("[USER MANAGEMENT MODULE]: Requested url type {0} for {1}", serverType, userID); // m_log.DebugFormat("[USER MANAGEMENT MODULE]: Requested url type {0} for {1}", serverType, userID);
if (userdata.ServerURLs != null && userdata.ServerURLs.ContainsKey(serverType) && userdata.ServerURLs[serverType] != null) if (userdata.ServerURLs != null)
{ {
return userdata.ServerURLs[serverType].ToString(); object url;
}
if (!string.IsNullOrEmpty(userdata.HomeURL)) if (userdata.ServerURLs.TryGetValue(serverType, out url))
return url.ToString();
}
else if (!string.IsNullOrEmpty(userdata.HomeURL))
{ {
//m_log.DebugFormat( //m_log.DebugFormat(
// "[USER MANAGEMENT MODULE]: Did not find url type {0} so requesting urls from '{1}' for {2}", // "[USER MANAGEMENT MODULE]: Did not find url type {0} so requesting urls from '{1}' for {2}",
@ -483,9 +485,11 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
m_log.Debug("[USER MANAGEMENT MODULE]: GetServerURLs call failed ", e); m_log.Debug("[USER MANAGEMENT MODULE]: GetServerURLs call failed ", e);
userdata.ServerURLs = new Dictionary<string, object>(); userdata.ServerURLs = new Dictionary<string, object>();
} }
if (userdata.ServerURLs != null && userdata.ServerURLs.ContainsKey(serverType) && userdata.ServerURLs[serverType] != null) object url;
return userdata.ServerURLs[serverType].ToString();
if (userdata.ServerURLs.TryGetValue(serverType, out url))
return url.ToString();
} }
} }