Add debug code

This commit is contained in:
games647
2023-04-12 09:53:04 +02:00
parent 4717bf82f7
commit 4abd6b9134

View File

@ -144,8 +144,11 @@ public abstract class SQLStorage implements AuthStorage {
@Override
public void save(StoredProfile playerProfile) {
String uuid = playerProfile.getOptId().map(UUIDAdapter::toMojangId).orElse(null);
core.getPlugin().getLog().info("Before Lock");
synchronized (playerProfile) {
core.getPlugin().getLog().info("Inside Lock - Before acquiring connection");
try (Connection con = dataSource.getConnection()) {
core.getPlugin().getLog().info("Acquired connection");
if (playerProfile.isSaved()) {
try (PreparedStatement saveStmt = con.prepareStatement(UPDATE_PROFILE)) {
saveStmt.setString(1, uuid);
@ -175,7 +178,11 @@ public abstract class SQLStorage implements AuthStorage {
} catch (SQLException ex) {
core.getPlugin().getLog().error("Failed to save playerProfile {}", playerProfile, ex);
}
core.getPlugin().getLog().info("Released connection");
}
core.getPlugin().getLog().info("Released lock");
}
@Override