mirror of
https://github.com/opensim/opensim.git
synced 2026-08-01 06:06:06 +08:00
change another expire and remove a redundant one
This commit is contained in:
@@ -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