From a944b4b69c31b9aaf7d5030a77dde7cb8741ba81 Mon Sep 17 00:00:00 2001 From: dankito Date: Sun, 1 Dec 2024 21:11:07 +0100 Subject: [PATCH] Reversing messages order so that newest emails get fetched first --- .../main/kotlin/net/codinux/invoicing/email/EmailsFetcher.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)