mirror of https://github.com/usbharu/Hideout.git
fix: モジュールが読み込まれない場合があったので修正
This commit is contained in:
parent
da22a2a29f
commit
0461656738
|
@ -32,21 +32,7 @@ import java.util.*
|
|||
|
||||
val logger = LoggerFactory.getLogger("MAIN")
|
||||
|
||||
fun main() {
|
||||
val moduleContexts = ServiceLoader.load(ModuleContext::class.java)
|
||||
|
||||
val moduleContext = moduleContexts.first()
|
||||
|
||||
logger.info("Use module name: {}", moduleContext)
|
||||
|
||||
|
||||
val koin = startKoin {
|
||||
printLogger()
|
||||
|
||||
val module = module {
|
||||
single<RetryPolicyFactory> {
|
||||
DefaultRetryPolicyFactory(mapOf("" to ExponentialRetryPolicy()))
|
||||
}
|
||||
val mainModule = module {
|
||||
single<AssignQueuedTaskDecider> {
|
||||
AssignQueuedTaskDeciderImpl(get(), get())
|
||||
}
|
||||
|
@ -96,7 +82,25 @@ fun main() {
|
|||
single { TaskResultService(taskManagementService = get(), propertySerializerFactory = get()) }
|
||||
single { TaskResultSubscribeService(taskManagementService = get(), propertySerializerFactory = get()) }
|
||||
}
|
||||
modules(module, moduleContext.module())
|
||||
|
||||
fun main() {
|
||||
val moduleContexts = ServiceLoader.load(ModuleContext::class.java)
|
||||
|
||||
val moduleContext = moduleContexts.first()
|
||||
|
||||
logger.info("Use module name: {}", moduleContext)
|
||||
|
||||
|
||||
val koin = startKoin {
|
||||
printLogger()
|
||||
|
||||
val module = module {
|
||||
single<RetryPolicyFactory> {
|
||||
DefaultRetryPolicyFactory(mapOf("" to ExponentialRetryPolicy()))
|
||||
}
|
||||
|
||||
}
|
||||
modules(mainModule, module, moduleContext.module())
|
||||
}
|
||||
|
||||
val application = koin.koin.get<OwlBrokerApplication>()
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
package dev.usbharu.owl.producer.embedded
|
||||
|
||||
import dev.usbharu.owl.broker.OwlBrokerApplication
|
||||
import dev.usbharu.owl.broker.mainModule
|
||||
import dev.usbharu.owl.common.retry.RetryPolicyFactory
|
||||
import dev.usbharu.owl.common.task.PublishedTask
|
||||
import dev.usbharu.owl.common.task.Task
|
||||
|
@ -41,7 +42,7 @@ class EmbeddedGrpcOwlProducer(
|
|||
config.retryPolicyFactory
|
||||
}
|
||||
}
|
||||
modules(module, config.moduleContext.module())
|
||||
modules(mainModule, module, config.moduleContext.module())
|
||||
}.koin
|
||||
|
||||
application.get<OwlBrokerApplication>().start(config.port.toInt())
|
||||
|
|
|
@ -19,6 +19,7 @@ package dev.usbharu.owl.producer.embedded
|
|||
import dev.usbharu.owl.broker.OwlBrokerApplication
|
||||
import dev.usbharu.owl.broker.domain.exception.InvalidRepositoryException
|
||||
import dev.usbharu.owl.broker.domain.model.producer.ProducerRepository
|
||||
import dev.usbharu.owl.broker.mainModule
|
||||
import dev.usbharu.owl.broker.service.*
|
||||
import dev.usbharu.owl.common.property.PropertySerializerFactory
|
||||
import dev.usbharu.owl.common.retry.RetryPolicyFactory
|
||||
|
@ -59,7 +60,7 @@ class EmbeddedOwlProducer(
|
|||
embeddedOwlProducerConfig.propertySerializerFactory
|
||||
}
|
||||
}
|
||||
modules(module, embeddedOwlProducerConfig.moduleContext.module())
|
||||
modules(mainModule, module, embeddedOwlProducerConfig.moduleContext.module())
|
||||
}.koin
|
||||
|
||||
application.getOrNull<ProducerRepository>()
|
||||
|
|
Loading…
Reference in New Issue