aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Servers/BaseOpenSimServer.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework/Servers/BaseOpenSimServer.cs')
-rw-r--r--OpenSim/Framework/Servers/BaseOpenSimServer.cs27
1 files changed, 26 insertions, 1 deletions
diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
index 3055865..60702d4 100644
--- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs
+++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
@@ -45,6 +45,7 @@ using OpenSim.Framework.Monitoring;
45using OpenSim.Framework.Servers; 45using OpenSim.Framework.Servers;
46using OpenSim.Framework.Servers.HttpServer; 46using OpenSim.Framework.Servers.HttpServer;
47using Timer=System.Timers.Timer; 47using Timer=System.Timers.Timer;
48using Nini.Config;
48 49
49namespace OpenSim.Framework.Servers 50namespace OpenSim.Framework.Servers
50{ 51{
@@ -56,10 +57,20 @@ namespace OpenSim.Framework.Servers
56 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 57 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
57 58
58 /// <summary> 59 /// <summary>
60 /// Used by tests to suppress Environment.Exit(0) so that post-run operations are possible.
61 /// </summary>
62 public bool SuppressExit { get; set; }
63
64 /// <summary>
59 /// This will control a periodic log printout of the current 'show stats' (if they are active) for this 65 /// This will control a periodic log printout of the current 'show stats' (if they are active) for this
60 /// server. 66 /// server.
61 /// </summary> 67 /// </summary>
68<<<<<<< HEAD
69 private int m_periodDiagnosticTimerMS = 60 * 60 * 1000;
70 private Timer m_periodicDiagnosticsTimer = new Timer(60 * 60 * 1000);
71=======
62// private Timer m_periodicDiagnosticsTimer = new Timer(60 * 60 * 1000); 72// private Timer m_periodicDiagnosticsTimer = new Timer(60 * 60 * 1000);
73>>>>>>> avn/ubitvar
63 74
64 /// <summary> 75 /// <summary>
65 /// Random uuid for private data 76 /// Random uuid for private data
@@ -77,8 +88,11 @@ namespace OpenSim.Framework.Servers
77 // Random uuid for private data 88 // Random uuid for private data
78 m_osSecret = UUID.Random().ToString(); 89 m_osSecret = UUID.Random().ToString();
79 90
91<<<<<<< HEAD
92=======
80// m_periodicDiagnosticsTimer.Elapsed += new ElapsedEventHandler(LogDiagnostics); 93// m_periodicDiagnosticsTimer.Elapsed += new ElapsedEventHandler(LogDiagnostics);
81// m_periodicDiagnosticsTimer.Enabled = true; 94// m_periodicDiagnosticsTimer.Enabled = true;
95>>>>>>> avn/ubitvar
82 } 96 }
83 97
84 /// <summary> 98 /// <summary>
@@ -89,6 +103,16 @@ namespace OpenSim.Framework.Servers
89 StatsManager.SimExtraStats = new SimExtraStatsCollector(); 103 StatsManager.SimExtraStats = new SimExtraStatsCollector();
90 RegisterCommonCommands(); 104 RegisterCommonCommands();
91 RegisterCommonComponents(Config); 105 RegisterCommonComponents(Config);
106
107 IConfig startupConfig = Config.Configs["Startup"];
108 int logShowStatsSeconds = startupConfig.GetInt("LogShowStatsSeconds", m_periodDiagnosticTimerMS / 1000);
109 m_periodDiagnosticTimerMS = logShowStatsSeconds * 1000;
110 m_periodicDiagnosticsTimer.Elapsed += new ElapsedEventHandler(LogDiagnostics);
111 if (m_periodDiagnosticTimerMS != 0)
112 {
113 m_periodicDiagnosticsTimer.Interval = m_periodDiagnosticTimerMS;
114 m_periodicDiagnosticsTimer.Enabled = true;
115 }
92 } 116 }
93 117
94 protected override void ShutdownSpecific() 118 protected override void ShutdownSpecific()
@@ -99,7 +123,8 @@ namespace OpenSim.Framework.Servers
99 123
100 base.ShutdownSpecific(); 124 base.ShutdownSpecific();
101 125
102 Environment.Exit(0); 126 if (!SuppressExit)
127 Environment.Exit(0);
103 } 128 }
104 129
105 /// <summary> 130 /// <summary>