From d4b510291350c6e40e0c021fde48e72be72cfbe6 Mon Sep 17 00:00:00 2001 From: Auxilor Date: Fri, 27 May 2022 16:01:44 +0100 Subject: [PATCH] Fixed MySQL --- .../spigot/data/storage/MySQLDataHandler.kt | 20 ++++--------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/internal/spigot/data/storage/MySQLDataHandler.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/internal/spigot/data/storage/MySQLDataHandler.kt index 3120eead..471de3aa 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/internal/spigot/data/storage/MySQLDataHandler.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/internal/spigot/data/storage/MySQLDataHandler.kt @@ -33,7 +33,6 @@ import java.util.UUID import java.util.concurrent.Callable import java.util.concurrent.ConcurrentHashMap import java.util.concurrent.Executors -import java.util.concurrent.Future import java.util.concurrent.TimeUnit /* @@ -172,7 +171,6 @@ private class ImplementedMySQLHandler( private val threadFactory = ThreadFactoryBuilder().setNameFormat("eco-mysql-thread-%d").build() private val executor = Executors.newFixedThreadPool(plugin.configYml.getInt("mysql.threads"), threadFactory) val registeredKeys = ConcurrentHashMap>() - private val currentlyProcessingRegistration = ConcurrentHashMap>() init { transaction { @@ -198,21 +196,11 @@ private class ImplementedMySQLHandler( return } - val future = currentlyProcessingRegistration[key] - - if (future != null) { - future.get() - return - } - - currentlyProcessingRegistration[key] = executor.submit { - transaction { - registerColumn(persistentKey, table) - SchemaUtils.createMissingTablesAndColumns(table, withLogs = false) - } - registeredKeys[key] = persistentKey - currentlyProcessingRegistration.remove(key) + transaction { + registerColumn(persistentKey, table) + SchemaUtils.createMissingTablesAndColumns(table, withLogs = false) } + registeredKeys[key] = persistentKey } fun write(uuid: UUID, key: PersistentDataKey, value: Any) {