In XAssetService, on a delete asset request also delete the asset in any chained service.

This eliminates the async migration since it causes a race condition with the "delete asset" console command
cpu-performance
Justin Clark-Casey (justincc) 2013-06-28 19:11:44 +01:00
parent f6ce87c96d
commit dc0455e217
2 changed files with 6 additions and 3 deletions

View File

@ -199,6 +199,8 @@ namespace OpenSim.Data.MySQL
/// <remarks>On failure : Throw an exception and attempt to reconnect to database</remarks>
public void StoreAsset(AssetBase asset)
{
// m_log.DebugFormat("[XASSETS DB]: Storing asset {0} {1}", asset.Name, asset.ID);
lock (m_dbLock)
{
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))

View File

@ -205,15 +205,16 @@ namespace OpenSim.Services.AssetService
if (!UUID.TryParse(id, out assetID))
return false;
// Don't bother deleting from a chained asset service. This isn't a big deal since deleting happens
// very rarely.
if (HasChainedAssetService)
m_ChainedAssetService.Delete(id);
return m_Database.Delete(id);
}
private void MigrateFromChainedService(AssetBase asset)
{
Util.FireAndForget(o => { Store(asset); m_ChainedAssetService.Delete(asset.ID); });
Store(asset);
m_ChainedAssetService.Delete(asset.ID);
}
}
}