From dc0455e217b8da3fc8bd49e959b57d6021312b77 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 28 Jun 2013 19:11:44 +0100 Subject: 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 --- OpenSim/Data/MySQL/MySQLXAssetData.cs | 2 ++ OpenSim/Services/AssetService/XAssetService.cs | 7 ++++--- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Data/MySQL/MySQLXAssetData.cs b/OpenSim/Data/MySQL/MySQLXAssetData.cs index 8c93825..91389ce 100644 --- a/OpenSim/Data/MySQL/MySQLXAssetData.cs +++ b/OpenSim/Data/MySQL/MySQLXAssetData.cs @@ -199,6 +199,8 @@ namespace OpenSim.Data.MySQL /// On failure : Throw an exception and attempt to reconnect to database 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)) diff --git a/OpenSim/Services/AssetService/XAssetService.cs b/OpenSim/Services/AssetService/XAssetService.cs index 8a2ca7c..6047616 100644 --- a/OpenSim/Services/AssetService/XAssetService.cs +++ b/OpenSim/Services/AssetService/XAssetService.cs @@ -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); } } } \ No newline at end of file -- cgit v1.1