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 7d9c76a..dbd9954 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 @@ -154,7 +154,7 @@ open class EmailsFetcher( // executed, making the overall process very slow -> use FetchProfile to prefetch requested data with a single request folder.fetch(messages, getFetchProfile(status)) - messages.mapNotNull { message -> + messages.reversed().mapNotNull { message -> async(coroutineDispatcher) { try { getEmail(message, status)