Temp DB fixes
This commit is contained in:
parent
f6a694b4fc
commit
c080d41dc2
@ -10,6 +10,7 @@ import java.util.List;
|
|||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import org.apache.commons.dbcp2.BasicDataSource;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import com.google.gson.reflect.TypeToken;
|
import com.google.gson.reflect.TypeToken;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
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
|
// First we try to grab the account id from cache - this saves an extra trip to database
|
||||||
int accountId = PlayerCache.getInstance().getAccountId(uuid);
|
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())
|
try (Connection connection = getConnection(); Statement statement = connection.createStatement())
|
||||||
{
|
{
|
||||||
if (accountId <= 0)
|
if (accountId <= 0)
|
||||||
@ -108,6 +110,8 @@ public class AccountRepository extends MinecraftRepository
|
|||||||
|
|
||||||
statement.execute(loginString);
|
statement.execute(loginString);
|
||||||
|
|
||||||
|
System.out.println("EXECUTE COMPLETE - " + accountId);
|
||||||
|
|
||||||
statement.getUpdateCount();
|
statement.getUpdateCount();
|
||||||
statement.getMoreResults();
|
statement.getMoreResults();
|
||||||
|
|
||||||
|
@ -194,7 +194,6 @@ public class PlayWireManager extends MiniDbClientPlugin<PlayWireClientData>
|
|||||||
{
|
{
|
||||||
PlayWireClientData client = new PlayWireClientData(accountId, MAX_TICKETS_PER_PERIOD, -1L);
|
PlayWireClientData client = new PlayWireClientData(accountId, MAX_TICKETS_PER_PERIOD, -1L);
|
||||||
Set(uuid, client);
|
Set(uuid, client);
|
||||||
_repository.attemptPlayWire(client, null, false);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@ public class MavericksManager extends MiniPlugin
|
|||||||
@EventHandler
|
@EventHandler
|
||||||
public void onUpdate(UpdateEvent event)
|
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) ->
|
Function<? super List<MavericksApprovedWrapper>, ? extends CompletionStage<Void>> updateTask = BukkitFuture.accept((list) ->
|
||||||
{
|
{
|
||||||
|
@ -30,8 +30,8 @@ public final class DBPool
|
|||||||
source.setUrl(url);
|
source.setUrl(url);
|
||||||
source.setUsername(username);
|
source.setUsername(username);
|
||||||
source.setPassword(password);
|
source.setPassword(password);
|
||||||
source.setMaxTotal(4);
|
source.setMaxTotal(5);
|
||||||
source.setMaxIdle(4);
|
source.setMaxIdle(5);
|
||||||
source.setTimeBetweenEvictionRunsMillis(180 * 1000);
|
source.setTimeBetweenEvictionRunsMillis(180 * 1000);
|
||||||
source.setSoftMinEvictableIdleTimeMillis(180 * 1000);
|
source.setSoftMinEvictableIdleTimeMillis(180 * 1000);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user