Removed sale notification.

Removed queue create table query.

Added try-catch for ServerMonitor to prevent stat storage from affecting normal operation.
This commit is contained in:
Jonathan Williams 2015-10-01 07:38:59 -07:00
parent eae894c879
commit 631bd9cfa6
3 changed files with 15 additions and 34 deletions

View File

@ -17,7 +17,7 @@ import mineplex.core.updater.event.UpdateEvent;
public class NotificationManager extends MiniPlugin
{
private boolean _enabled = true;
private boolean _enabled = false;
private CoreClientManager _clientManager;

View File

@ -30,32 +30,6 @@ public class QueueRepository
public void initialize()
{
PreparedStatement preparedStatement = null;
try (Connection connection = DBPool.QUEUE.getConnection())
{
// Create table
preparedStatement = connection.prepareStatement(CREATE_ELO_QUEUE_TABLE);
preparedStatement.execute();
}
catch (Exception exception)
{
exception.printStackTrace();
}
finally
{
if (preparedStatement != null)
{
try
{
preparedStatement.close();
}
catch (SQLException e)
{
e.printStackTrace();
}
}
}
}
public void deleteQueueRecord(PlayerMatchStatus matchStatus)

View File

@ -183,12 +183,19 @@ public class ServerMonitor
log("Using " + usedCpuPercent + "% of available CPU (" + availableCPU + " Free) and " + usedRamPercent + "% of available RAM (" + availableRAM / 1000 + "GB Free)");
_historyRepository.saveDedicatedServerStats(_dedicatedServers);
log("Saved Dedicated Server Stats.");
_historyRepository.saveServerGroupStats((int)totalCPU, (int)totalRAM, _serverGroupMap.values());
log("Saved ServerGroup Stats.");
_historyRepository.saveNetworkStats(usedCpuPercent, usedRamPercent, availableCPU, availableRAM, _region);
log("Saved Network Stats.");
try
{
_historyRepository.saveDedicatedServerStats(_dedicatedServers);
log("Saved Dedicated Server Stats.");
_historyRepository.saveServerGroupStats((int)totalCPU, (int)totalRAM, _serverGroupMap.values());
log("Saved ServerGroup Stats.");
_historyRepository.saveNetworkStats(usedCpuPercent, usedRamPercent, availableCPU, availableRAM, _region);
log("Saved Network Stats.");
}
catch (Exception ex)
{
ex.printStackTrace();
}
if (_count == 0)
{
@ -366,7 +373,7 @@ public class ServerMonitor
catch (Exception ex)
{
log("Error doing something : " + ex.getMessage());
ex.printStackTrace();
try
{
Thread.sleep(1000);