Temp DB fixes

This commit is contained in:
Shaun Bennett 2016-11-17 19:08:32 -05:00
parent f6a694b4fc
commit c080d41dc2
4 changed files with 7 additions and 4 deletions

View File

@ -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)
@ -108,6 +110,8 @@ public class AccountRepository extends MinecraftRepository
statement.execute(loginString);
System.out.println("EXECUTE COMPLETE - " + accountId);
statement.getUpdateCount();
statement.getMoreResults();

View File

@ -194,7 +194,6 @@ public class PlayWireManager extends MiniDbClientPlugin<PlayWireClientData>
{
PlayWireClientData client = new PlayWireClientData(accountId, MAX_TICKETS_PER_PERIOD, -1L);
Set(uuid, client);
_repository.attemptPlayWire(client, null, false);
}
}

View File

@ -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<? super List<MavericksApprovedWrapper>, ? extends CompletionStage<Void>> updateTask = BukkitFuture.accept((list) ->
{

View File

@ -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);