mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 00:46:02 +08:00
Add a timer to monitor the heartbeat. Restart it if it's been dead for
5 seconds.
This commit is contained in:
@@ -487,6 +487,7 @@ namespace OpenSim
|
||||
}
|
||||
|
||||
scene.StartTimer();
|
||||
scene.StartTimerWatchdog();
|
||||
|
||||
return clientServer;
|
||||
}
|
||||
|
||||
@@ -109,6 +109,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
protected int m_splitRegionID;
|
||||
protected Timer m_restartWaitTimer = new Timer();
|
||||
protected Timer m_timerWatchdog = new Timer();
|
||||
protected List<RegionInfo> m_regionRestartNotifyList = new List<RegionInfo>();
|
||||
protected List<RegionInfo> m_neighbours = new List<RegionInfo>();
|
||||
protected string m_simulatorVersion = "OpenSimulator Server";
|
||||
@@ -191,7 +192,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
private bool m_scripts_enabled = true;
|
||||
private string m_defaultScriptEngine;
|
||||
private int m_LastLogin;
|
||||
private Thread HeartbeatThread;
|
||||
private Thread HeartbeatThread = null;
|
||||
private volatile bool shuttingdown;
|
||||
|
||||
private int m_lastUpdate;
|
||||
@@ -4886,7 +4887,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
if (m_firstHeartbeat)
|
||||
return;
|
||||
|
||||
if (Util.EnvironmentTickCountSubtract(m_lastUpdate) > 10000)
|
||||
if (Util.EnvironmentTickCountSubtract(m_lastUpdate) > 5000)
|
||||
StartTimer();
|
||||
}
|
||||
|
||||
@@ -5380,5 +5381,18 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
reason = String.Empty;
|
||||
return true;
|
||||
}
|
||||
|
||||
public void StartTimerWatchdog()
|
||||
{
|
||||
m_timerWatchdog.Interval = 1000;
|
||||
m_timerWatchdog.Elapsed += TimerWatchdog;
|
||||
m_timerWatchdog.AutoReset = true;
|
||||
m_timerWatchdog.Start();
|
||||
}
|
||||
|
||||
public void TimerWatchdog(object sender, ElapsedEventArgs e)
|
||||
{
|
||||
CheckHeartbeat();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user