Rename UuidGather.m_assetCache to m_assetService. If HGUuidGatherer hasn't been instantiated with an assetServerURL then call down to overriden UuidGatherer.GetAsset() instead of calling m_assetService.GetAsset() itself - these two codepaths are now identical.

0.7.4-extended
Justin Clark-Casey (justincc) 2012-09-21 01:57:13 +01:00
parent 8068c083f6
commit 2da6cfde80
2 changed files with 6 additions and 9 deletions

View File

@ -40,7 +40,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
protected string m_assetServerURL; protected string m_assetServerURL;
protected HGAssetMapper m_assetMapper; protected HGAssetMapper m_assetMapper;
public HGUuidGatherer(HGAssetMapper assMap, IAssetService assetCache, string assetServerURL) : base(assetCache) public HGUuidGatherer(HGAssetMapper assMap, IAssetService assetService, string assetServerURL) : base(assetService)
{ {
m_assetMapper = assMap; m_assetMapper = assMap;
m_assetServerURL = assetServerURL; m_assetServerURL = assetServerURL;
@ -49,7 +49,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
protected override AssetBase GetAsset(UUID uuid) protected override AssetBase GetAsset(UUID uuid)
{ {
if (string.Empty == m_assetServerURL) if (string.Empty == m_assetServerURL)
return m_assetCache.Get(uuid.ToString()); return base.GetAsset(uuid);
else else
return m_assetMapper.FetchAsset(m_assetServerURL, uuid); return m_assetMapper.FetchAsset(m_assetServerURL, uuid);
} }

View File

@ -53,10 +53,7 @@ namespace OpenSim.Region.Framework.Scenes
{ {
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
/// <summary> protected IAssetService m_assetService;
/// Asset cache used for gathering assets
/// </summary>
protected IAssetService m_assetCache;
// /// <summary> // /// <summary>
// /// Used as a temporary store of an asset which represents an object. This can be a null if no appropriate // /// Used as a temporary store of an asset which represents an object. This can be a null if no appropriate
@ -71,7 +68,7 @@ namespace OpenSim.Region.Framework.Scenes
public UuidGatherer(IAssetService assetCache) public UuidGatherer(IAssetService assetCache)
{ {
m_assetCache = assetCache; m_assetService = assetCache;
} }
/// <summary> /// <summary>
@ -216,7 +213,7 @@ namespace OpenSim.Region.Framework.Scenes
/// <returns></returns> /// <returns></returns>
protected virtual AssetBase GetAsset(UUID uuid) protected virtual AssetBase GetAsset(UUID uuid)
{ {
return m_assetCache.Get(uuid.ToString()); return m_assetService.Get(uuid.ToString());
// XXX: Switching to do this synchronously where the call was async before but we always waited for it // XXX: Switching to do this synchronously where the call was async before but we always waited for it
// to complete anyway! // to complete anyway!