From c080d41dc2c1aa925aa14ce91a48a93daedd59c0 Mon Sep 17 00:00:00 2001 From: Shaun Bennett Date: Thu, 17 Nov 2016 19:08:32 -0500 Subject: [PATCH] Temp DB fixes --- .../mineplex/core/account/repository/AccountRepository.java | 4 ++++ .../src/mineplex/core/playwire/PlayWireManager.java | 1 - .../src/mineplex/hub/modules/MavericksManager.java | 2 +- .../src/mineplex/serverdata/database/DBPool.java | 4 ++-- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/account/repository/AccountRepository.java b/Plugins/Mineplex.Core/src/mineplex/core/account/repository/AccountRepository.java index e30cabf81..0a5fea8d8 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/account/repository/AccountRepository.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/account/repository/AccountRepository.java @@ -10,6 +10,7 @@ import java.util.List; import java.util.UUID; import java.util.stream.Collectors; +import org.apache.commons.dbcp2.BasicDataSource; import org.bukkit.Bukkit; import com.google.gson.reflect.TypeToken; import org.bukkit.plugin.java.JavaPlugin; @@ -62,6 +63,7 @@ public class AccountRepository extends MinecraftRepository // First we try to grab the account id from cache - this saves an extra trip to database int accountId = PlayerCache.getInstance().getAccountId(uuid); + System.out.println("LOGIN... IDLE: " + ((BasicDataSource) DBPool.getAccount()).getNumIdle() + " ACTIVE: " + ((BasicDataSource) DBPool.getAccount()).getNumActive()); try (Connection connection = getConnection(); Statement statement = connection.createStatement()) { if (accountId <= 0) @@ -107,6 +109,8 @@ public class AccountRepository extends MinecraftRepository loginString += loginProcessors.parallelStream().map(processor -> processor.getQuery(finalId, uuidString, name)).collect(Collectors.joining()); statement.execute(loginString); + + System.out.println("EXECUTE COMPLETE - " + accountId); statement.getUpdateCount(); statement.getMoreResults(); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/playwire/PlayWireManager.java b/Plugins/Mineplex.Core/src/mineplex/core/playwire/PlayWireManager.java index 017b3a0d1..55bb0f348 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/playwire/PlayWireManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/playwire/PlayWireManager.java @@ -194,7 +194,6 @@ public class PlayWireManager extends MiniDbClientPlugin { PlayWireClientData client = new PlayWireClientData(accountId, MAX_TICKETS_PER_PERIOD, -1L); Set(uuid, client); - _repository.attemptPlayWire(client, null, false); } } diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/MavericksManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/MavericksManager.java index e84d6a60b..b2fe7dd90 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/MavericksManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/MavericksManager.java @@ -80,7 +80,7 @@ public class MavericksManager extends MiniPlugin @EventHandler public void onUpdate(UpdateEvent event) { - if(event.getType() != UpdateType.SLOW) return; + if(event.getType() != UpdateType.MIN_01) return; Function, ? extends CompletionStage> updateTask = BukkitFuture.accept((list) -> { diff --git a/Plugins/Mineplex.ServerData/src/mineplex/serverdata/database/DBPool.java b/Plugins/Mineplex.ServerData/src/mineplex/serverdata/database/DBPool.java index acc786379..be17d13f2 100644 --- a/Plugins/Mineplex.ServerData/src/mineplex/serverdata/database/DBPool.java +++ b/Plugins/Mineplex.ServerData/src/mineplex/serverdata/database/DBPool.java @@ -30,8 +30,8 @@ public final class DBPool source.setUrl(url); source.setUsername(username); source.setPassword(password); - source.setMaxTotal(4); - source.setMaxIdle(4); + source.setMaxTotal(5); + source.setMaxIdle(5); source.setTimeBetweenEvictionRunsMillis(180 * 1000); source.setSoftMinEvictableIdleTimeMillis(180 * 1000);