Skip to content

Commit 11a394e

Browse files
committed
chore: revert
1 parent 57da18b commit 11a394e

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

src/main/kotlin/co/statu/rule/database/DatabaseManager.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import io.vertx.core.json.JsonObject
1010
import io.vertx.jdbcclient.JDBCPool
1111
import org.slf4j.Logger
1212
import org.springframework.beans.factory.config.ConfigurableBeanFactory
13-
import org.springframework.context.annotation.Lazy
1413
import org.springframework.context.annotation.Scope
1514
import org.springframework.stereotype.Component
1615
import java.sql.BatchUpdateException
@@ -21,8 +20,12 @@ import kotlin.system.exitProcess
2120
class DatabaseManager(
2221
private val vertx: Vertx,
2322
private val logger: Logger,
24-
@Lazy private val pluginConfigManager: PluginConfigManager<DatabaseConfig>
23+
private val databasePlugin: DatabasePlugin
2524
) {
25+
private val pluginConfigManager by lazy {
26+
databasePlugin.pluginBeanContext.getBean(PluginConfigManager::class.java) as PluginConfigManager<DatabaseConfig>
27+
}
28+
2629
private lateinit var pool: JDBCPool
2730

2831
private val tables = mutableMapOf<ParsekPlugin, MutableList<Dao<*>>>()

src/main/kotlin/co/statu/rule/database/event/CoreEventHandler.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,16 @@ import co.statu.rule.database.DatabaseConfig
99
import co.statu.rule.database.DatabaseManager
1010
import co.statu.rule.database.DatabasePlugin
1111
import org.slf4j.Logger
12-
import org.springframework.context.annotation.Lazy
1312

1413
@EventListener
1514
class CoreEventHandler(
1615
private val logger: Logger,
1716
private val databasePlugin: DatabasePlugin,
18-
@Lazy private val databaseManager: DatabaseManager
1917
) : CoreEventListener {
18+
private val databaseManager by lazy {
19+
databasePlugin.pluginBeanContext.getBean(DatabaseManager::class.java)
20+
}
21+
2022
override suspend fun onConfigManagerReady(configManager: ConfigManager) {
2123
val pluginConfigManager = PluginConfigManager(
2224
databasePlugin,

0 commit comments

Comments
 (0)