Added try catch in BungeeRotator and ServerMonitor so they don't crash out.
This commit is contained in:
parent
6383cf7ce6
commit
beac0b4828
@ -34,6 +34,8 @@ public class BungeeRotator
|
||||
int maxRecordCount = 10;
|
||||
|
||||
while (true)
|
||||
{
|
||||
try
|
||||
{
|
||||
List<BungeeServer> bungeeServers = _repository.getBungeeServers();
|
||||
HashSet<String> usServers = new HashSet<String>();
|
||||
@ -179,5 +181,19 @@ public class BungeeRotator
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
System.out.println("Error doing something : " + ex.getMessage());
|
||||
|
||||
try
|
||||
{
|
||||
Thread.sleep(1000);
|
||||
}
|
||||
catch (InterruptedException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -88,6 +88,8 @@ public class ServerMonitor
|
||||
HashMap<String, Entry<String, Long>> serverTracker = new HashMap<String, Entry<String, Long>>();
|
||||
|
||||
while (true)
|
||||
{
|
||||
try
|
||||
{
|
||||
_totalPlayers = 0;
|
||||
_serverStatuses = _repository.getServerStatuses();
|
||||
@ -331,6 +333,20 @@ public class ServerMonitor
|
||||
|
||||
_count++;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log("Error doing something : " + ex.getMessage());
|
||||
|
||||
try
|
||||
{
|
||||
Thread.sleep(1000);
|
||||
}
|
||||
catch (InterruptedException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void killDeadServers()
|
||||
|
Loading…
Reference in New Issue
Block a user