* Resolve bug where save oar would never complete if any assets were missing
parent
3791386d4d
commit
c11e047410
|
@ -150,6 +150,11 @@ namespace OpenSim.Framework
|
||||||
get { return m_metadata; }
|
get { return m_metadata; }
|
||||||
set { m_metadata = value; }
|
set { m_metadata = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
return FullID.ToString();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class AssetMetadata
|
public class AssetMetadata
|
||||||
|
|
|
@ -85,9 +85,9 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||||
m_log.DebugFormat("[ARCHIVER]: Could not find asset {0}", uuid);
|
m_log.DebugFormat("[ARCHIVER]: Could not find asset {0}", uuid);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_log.InfoFormat(
|
// m_log.InfoFormat(
|
||||||
"[ARCHIVER]: Received {0} of {1} assets requested",
|
// "[ARCHIVER]: Received {0} of {1} assets requested",
|
||||||
assetsFoundUuids.Count, assetsFoundUuids.Count + assetsNotFoundUuids.Count);
|
// assetsFoundUuids.Count, assetsFoundUuids.Count + assetsNotFoundUuids.Count);
|
||||||
|
|
||||||
m_log.InfoFormat("[ARCHIVER]: Creating archive file. This may take some time.");
|
m_log.InfoFormat("[ARCHIVER]: Creating archive file. This may take some time.");
|
||||||
|
|
||||||
|
|
|
@ -144,8 +144,10 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||||
|
|
||||||
m_assetsWritten++;
|
m_assetsWritten++;
|
||||||
|
|
||||||
|
//m_log.DebugFormat("[ARCHIVER]: Added asset {0}", m_assetsWritten);
|
||||||
|
|
||||||
if (m_assetsWritten % LOG_ASSET_LOAD_NOTIFICATION_INTERVAL == 0)
|
if (m_assetsWritten % LOG_ASSET_LOAD_NOTIFICATION_INTERVAL == 0)
|
||||||
m_log.InfoFormat("[ARCHIVER]: Added {0} assets to archive", m_assetsWritten);
|
m_log.InfoFormat("[ARCHIVER]: Added {0} assets to archive", m_assetsWritten);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -97,15 +97,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||||
|
|
||||||
foreach (UUID uuid in m_uuids)
|
foreach (UUID uuid in m_uuids)
|
||||||
{
|
{
|
||||||
m_assetCache.Get(uuid.ToString(), this, AssetReceived);
|
m_assetCache.Get(uuid.ToString(), this, AssetRequestCallback);
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void AssetReceived(string id, object sender, AssetBase asset)
|
|
||||||
{
|
|
||||||
if (asset != null)
|
|
||||||
{
|
|
||||||
AssetRequestCallback(asset.FullID, asset);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -114,24 +106,24 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="assetID"></param>
|
/// <param name="assetID"></param>
|
||||||
/// <param name="asset"></param>
|
/// <param name="asset"></param>
|
||||||
public void AssetRequestCallback(UUID assetID, AssetBase asset)
|
public void AssetRequestCallback(string id, object sender, AssetBase asset)
|
||||||
{
|
{
|
||||||
//m_log.DebugFormat("[ARCHIVER]: Received callback for asset {0}", assetID);
|
//m_log.DebugFormat("[ARCHIVER]: Received callback for asset {0}", assetID);
|
||||||
|
|
||||||
if (asset != null)
|
if (asset != null)
|
||||||
{
|
{
|
||||||
m_foundAssetUuids.Add(assetID);
|
m_foundAssetUuids.Add(asset.FullID);
|
||||||
m_assetsArchiver.WriteAsset(asset);
|
m_assetsArchiver.WriteAsset(asset);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_notFoundAssetUuids.Add(assetID);
|
m_notFoundAssetUuids.Add(new UUID(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_foundAssetUuids.Count + m_notFoundAssetUuids.Count == m_repliesRequired)
|
if (m_foundAssetUuids.Count + m_notFoundAssetUuids.Count == m_repliesRequired)
|
||||||
{
|
{
|
||||||
m_log.DebugFormat(
|
m_log.DebugFormat(
|
||||||
"[ARCHIVER]: Successfully received {0} assets and notification of {1} missing assets",
|
"[ARCHIVER]: Successfully added {0} assets ({1} assets missing)",
|
||||||
m_foundAssetUuids.Count, m_notFoundAssetUuids.Count);
|
m_foundAssetUuids.Count, m_notFoundAssetUuids.Count);
|
||||||
|
|
||||||
// We want to stop using the asset cache thread asap
|
// We want to stop using the asset cache thread asap
|
||||||
|
|
|
@ -98,6 +98,8 @@ namespace OpenSim.Services.AssetService
|
||||||
|
|
||||||
public bool Get(string id, Object sender, AssetRetrieved handler)
|
public bool Get(string id, Object sender, AssetRetrieved handler)
|
||||||
{
|
{
|
||||||
|
//m_log.DebugFormat("[AssetService]: Got request for {0}", id);
|
||||||
|
|
||||||
UUID assetID;
|
UUID assetID;
|
||||||
|
|
||||||
if (!UUID.TryParse(id, out assetID))
|
if (!UUID.TryParse(id, out assetID))
|
||||||
|
@ -105,6 +107,8 @@ namespace OpenSim.Services.AssetService
|
||||||
|
|
||||||
AssetBase asset = m_Database.FetchAsset(assetID);
|
AssetBase asset = m_Database.FetchAsset(assetID);
|
||||||
|
|
||||||
|
//m_log.DebugFormat("[AssetService]: Got asset {0}", asset);
|
||||||
|
|
||||||
handler(id, sender, asset);
|
handler(id, sender, asset);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in New Issue