Skip to content

Commit 818cac4

Browse files
committed
fix: fixed plugins not starting correctly
1 parent 1327f8c commit 818cac4

2 files changed

Lines changed: 11 additions & 5 deletions

File tree

src/main/kotlin/co/statu/parsek/Main.kt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import io.vertx.core.VertxOptions
1010
import io.vertx.ext.web.Router
1111
import io.vertx.kotlin.coroutines.CoroutineVerticle
1212
import io.vertx.kotlin.coroutines.coAwait
13+
import kotlinx.coroutines.runBlocking
1314
import org.slf4j.LoggerFactory
1415
import org.springframework.context.annotation.AnnotationConfigApplicationContext
1516

@@ -130,7 +131,17 @@ class Main : CoroutineVerticle() {
130131

131132
logger.info("Enabling plugins")
132133

134+
pluginManager.getPluginWrappers().forEach {
135+
pluginManager.enablePlugin(it.pluginId)
136+
}
137+
133138
pluginManager.startPlugins()
139+
140+
runBlocking {
141+
pluginManager.getActivePlugins().forEach {
142+
it.onStart()
143+
}
144+
}
134145
}
135146

136147
private fun initDependencyInjection() {

src/main/kotlin/co/statu/parsek/api/ParsekPlugin.kt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,6 @@ abstract class ParsekPlugin : Plugin() {
9090

9191
@Deprecated("Use onStart method.")
9292
override fun start() {
93-
runBlocking {
94-
withContext(Dispatchers.IO) {
95-
onStart()
96-
}
97-
}
9893
}
9994

10095
@Deprecated("Use onStop method.")

0 commit comments

Comments
 (0)