mirror of
https://github.com/opensim/opensim.git
synced 2026-08-07 17:55:48 +08:00
throtle datasnapshot gen
This commit is contained in:
@@ -32,6 +32,7 @@ using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Reflection;
|
||||
using System.Threading;
|
||||
using System.Text;
|
||||
using System.Xml;
|
||||
using log4net;
|
||||
@@ -64,6 +65,7 @@ namespace OpenSim.Region.DataSnapshot
|
||||
//Various internal objects
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
internal object m_syncInit = new object();
|
||||
private object m_serializeGen = new object();
|
||||
|
||||
//DataServices and networking
|
||||
private string m_dataServices = "noservices";
|
||||
@@ -321,6 +323,11 @@ namespace OpenSim.Region.DataSnapshot
|
||||
*/
|
||||
public XmlDocument GetSnapshot(string regionName)
|
||||
{
|
||||
if(!Monitor.TryEnter(m_serializeGen,30000))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
CheckStale();
|
||||
|
||||
XmlDocument requestedSnap = new XmlDocument();
|
||||
@@ -360,9 +367,13 @@ namespace OpenSim.Region.DataSnapshot
|
||||
m_log.Warn("[DATASNAPSHOT]: Caught unknown exception while trying to load snapshot: " + e.StackTrace);
|
||||
requestedSnap = GetErrorMessage(regionName, e);
|
||||
}
|
||||
|
||||
finally
|
||||
{
|
||||
Monitor.Exit(m_serializeGen);
|
||||
}
|
||||
|
||||
return requestedSnap;
|
||||
|
||||
}
|
||||
|
||||
private XmlDocument GetErrorMessage(string regionName, Exception e)
|
||||
|
||||
Reference in New Issue
Block a user