mirror of
https://github.com/opensim/opensim.git
synced 2026-05-15 11:25:39 +08:00
change another expire and remove a redundant one
This commit is contained in:
@@ -49,9 +49,6 @@ namespace OpenSim.Services.Connectors
|
||||
|
||||
private string m_ServerURI = String.Empty;
|
||||
|
||||
private ExpiringCache<ulong, GridRegion> m_regionCache =
|
||||
new ExpiringCache<ulong, GridRegion>();
|
||||
|
||||
public GridServicesConnector()
|
||||
{
|
||||
}
|
||||
@@ -279,11 +276,6 @@ namespace OpenSim.Services.Connectors
|
||||
public GridRegion GetRegionByPosition(UUID scopeID, int x, int y)
|
||||
{
|
||||
GridRegion rinfo = null;
|
||||
ulong regionHandle = Util.UIntsToLong((uint)x, (uint)y);
|
||||
|
||||
// this cache includes NULL regions
|
||||
if (m_regionCache.TryGetValue(regionHandle, out rinfo))
|
||||
return rinfo;
|
||||
|
||||
Dictionary<string, object> sendData = new Dictionary<string, object>();
|
||||
|
||||
@@ -325,8 +317,6 @@ namespace OpenSim.Services.Connectors
|
||||
else
|
||||
m_log.DebugFormat("[GRID CONNECTOR]: GetRegionByPosition received null reply");
|
||||
|
||||
m_regionCache.Add(regionHandle, rinfo, TimeSpan.FromSeconds(600));
|
||||
|
||||
return rinfo;
|
||||
}
|
||||
|
||||
|
||||
@@ -43,9 +43,7 @@ namespace OpenSim.Services.Connectors
|
||||
{
|
||||
public class PresenceServicesConnector : BaseServiceConnector, IPresenceService
|
||||
{
|
||||
private static readonly ILog m_log =
|
||||
LogManager.GetLogger(
|
||||
MethodBase.GetCurrentMethod().DeclaringType);
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private string m_ServerURI = String.Empty;
|
||||
|
||||
|
||||
@@ -50,11 +50,9 @@ namespace OpenSim.Services.HypergridService
|
||||
/// </summary>
|
||||
public class HGInstantMessageService : IInstantMessage
|
||||
{
|
||||
private static readonly ILog m_log =
|
||||
LogManager.GetLogger(
|
||||
MethodBase.GetCurrentMethod().DeclaringType);
|
||||
private static readonly ILog m_log = LogManager.GetLogger( MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private const double CACHE_EXPIRATION_SECONDS = 120000.0; // 33 hours
|
||||
private const int REGIONCACHE_EXPIRATION = 300000;
|
||||
|
||||
static bool m_Initialized = false;
|
||||
|
||||
@@ -65,8 +63,8 @@ namespace OpenSim.Services.HypergridService
|
||||
|
||||
protected static IInstantMessageSimConnector m_IMSimConnector;
|
||||
|
||||
protected static Dictionary<UUID, object> m_UserLocationMap = new Dictionary<UUID, object>();
|
||||
private static ExpiringCache<UUID, GridRegion> m_RegionCache;
|
||||
protected static readonly Dictionary<UUID, object> m_UserLocationMap = new Dictionary<UUID, object>();
|
||||
private static readonly ExpiringCacheOS<UUID, GridRegion> m_RegionCache = new ExpiringCacheOS<UUID, GridRegion>(60000);
|
||||
|
||||
private static bool m_ForwardOfflineGroupMessages;
|
||||
private static bool m_InGatekeeper;
|
||||
@@ -111,8 +109,6 @@ namespace OpenSim.Services.HypergridService
|
||||
m_log.WarnFormat("[HG IM SERVICE]: Unable to create User Agent Service. Missing config var in [HGInstantMessageService]?");
|
||||
}
|
||||
|
||||
m_RegionCache = new ExpiringCache<UUID, GridRegion>();
|
||||
|
||||
IConfig cnf = config.Configs["Messaging"];
|
||||
if (cnf == null)
|
||||
{
|
||||
@@ -275,11 +271,10 @@ namespace OpenSim.Services.HypergridService
|
||||
{
|
||||
bool imresult = false;
|
||||
GridRegion reginfo = null;
|
||||
if (!m_RegionCache.TryGetValue(upd.RegionID, out reginfo))
|
||||
if (!m_RegionCache.TryGetValue(upd.RegionID, REGIONCACHE_EXPIRATION, out reginfo))
|
||||
{
|
||||
reginfo = m_GridService.GetRegionByUUID(UUID.Zero /*!!!*/, upd.RegionID);
|
||||
if (reginfo != null)
|
||||
m_RegionCache.AddOrUpdate(upd.RegionID, reginfo, CACHE_EXPIRATION_SECONDS);
|
||||
m_RegionCache.AddOrUpdate(upd.RegionID, reginfo, reginfo == null ? 60000 : REGIONCACHE_EXPIRATION);
|
||||
}
|
||||
|
||||
if (reginfo != null)
|
||||
|
||||
Reference in New Issue
Block a user