From c3cf0652b2d96c1739001d8862236a377dcc009d Mon Sep 17 00:00:00 2001 From: dankito Date: Tue, 26 Nov 2024 03:38:35 +0100 Subject: [PATCH] Made coroutineDispatcher configurable --- .../main/kotlin/net/codinux/invoicing/email/EmailsFetcher.kt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/e-invoice-domain/src/main/kotlin/net/codinux/invoicing/email/EmailsFetcher.kt b/e-invoice-domain/src/main/kotlin/net/codinux/invoicing/email/EmailsFetcher.kt index 3e52d5d..d775b09 100644 --- a/e-invoice-domain/src/main/kotlin/net/codinux/invoicing/email/EmailsFetcher.kt +++ b/e-invoice-domain/src/main/kotlin/net/codinux/invoicing/email/EmailsFetcher.kt @@ -23,7 +23,8 @@ import java.util.concurrent.Executors import kotlin.math.max open class EmailsFetcher( - protected open val eInvoiceReader: EInvoiceReader = EInvoiceReader() + protected open val eInvoiceReader: EInvoiceReader = EInvoiceReader(), + protected open val coroutineDispatcher: CoroutineDispatcher = Executors.newFixedThreadPool(max(24, Runtime.getRuntime().availableProcessors() * 4)).asCoroutineDispatcher() ) { protected data class MessagePart( @@ -32,8 +33,6 @@ open class EmailsFetcher( ) - protected open val coroutineDispatcher = Executors.newFixedThreadPool(max(24, Runtime.getRuntime().availableProcessors() * 4)).asCoroutineDispatcher() - protected val log by logger()