* Put an Enabled switch on the async object deleter for future testing purposes

0.6.1-post-fixes
Justin Clarke Casey 2008-11-11 20:33:29 +00:00
parent 47a5d71b7e
commit a814ac3d67
3 changed files with 21 additions and 3 deletions

View File

@ -54,9 +54,14 @@ namespace OpenSim.Region.Environment.Scenes
private static readonly ILog m_log private static readonly ILog m_log
= LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
/// <value>
/// Is the deleter currently enabled?
/// </value>
public bool Enabled;
private Timer m_inventoryTicker = new Timer(2000); private Timer m_inventoryTicker = new Timer(2000);
private readonly Queue<DeleteToInventoryHolder> m_inventoryDeletes = new Queue<DeleteToInventoryHolder>(); private readonly Queue<DeleteToInventoryHolder> m_inventoryDeletes = new Queue<DeleteToInventoryHolder>();
private Scene m_scene; private Scene m_scene;
public AsyncSceneObjectGroupDeleter(Scene scene) public AsyncSceneObjectGroupDeleter(Scene scene)
{ {
@ -73,7 +78,8 @@ namespace OpenSim.Region.Environment.Scenes
SceneObjectGroup objectGroup, IClientAPI remoteClient, SceneObjectGroup objectGroup, IClientAPI remoteClient,
bool permissionToDelete) bool permissionToDelete)
{ {
m_inventoryTicker.Stop(); if (Enabled)
m_inventoryTicker.Stop();
lock (m_inventoryDeletes) lock (m_inventoryDeletes)
{ {
@ -87,7 +93,8 @@ namespace OpenSim.Region.Environment.Scenes
m_inventoryDeletes.Enqueue(dtis); m_inventoryDeletes.Enqueue(dtis);
} }
m_inventoryTicker.Start(); if (Enabled)
m_inventoryTicker.Start();
// Visually remove it, even if it isnt really gone yet. // Visually remove it, even if it isnt really gone yet.
if (permissionToDelete) if (permissionToDelete)
@ -132,6 +139,7 @@ namespace OpenSim.Region.Environment.Scenes
m_log.DebugFormat("Exception background deleting object: "+e.ToString()); m_log.DebugFormat("Exception background deleting object: "+e.ToString());
} }
} }
return true; return true;
} }
} }

View File

@ -281,7 +281,9 @@ namespace OpenSim.Region.Environment.Scenes
m_eventManager = new EventManager(); m_eventManager = new EventManager();
m_externalChecks = new SceneExternalChecks(this); m_externalChecks = new SceneExternalChecks(this);
m_asyncSceneObjectDeleter = new AsyncSceneObjectGroupDeleter(this); m_asyncSceneObjectDeleter = new AsyncSceneObjectGroupDeleter(this);
m_asyncSceneObjectDeleter.Enabled = true;
// Load region settings // Load region settings
m_regInfo.RegionSettings = m_storageManager.DataStore.LoadRegionSettings(m_regInfo.RegionID); m_regInfo.RegionSettings = m_storageManager.DataStore.LoadRegionSettings(m_regInfo.RegionID);

View File

@ -106,5 +106,13 @@ namespace OpenSim.Region.Environment.Scenes.Tests
// If the parts have the same UUID then we will consider them as one and the same // If the parts have the same UUID then we will consider them as one and the same
Assert.That(retrievedPart.UUID, Is.EqualTo(part.UUID)); Assert.That(retrievedPart.UUID, Is.EqualTo(part.UUID));
} }
/*
public void TestRemoveSceneObject()
{
Scene scene = SetupScene();
SceneObjectPart part = AddSceneObject(scene);
}
*/
} }
} }