Removed unnecessary async { }
This commit is contained in:
parent
1e372cf592
commit
c65d99e35d
|
@ -117,23 +117,21 @@ open class EmailsFetcher(
|
||||||
return@runBlocking emptyList()
|
return@runBlocking emptyList()
|
||||||
}
|
}
|
||||||
|
|
||||||
async(coroutineDispatcher) {
|
val startUid = max(status.options.lastRetrievedMessageId?.let { it + 1 } ?: 0, 1) // message numbers start at 1
|
||||||
val startUid = max(status.options.lastRetrievedMessageId?.let { it + 1 } ?: 0, 1) // message numbers start at 1
|
|
||||||
|
|
||||||
folder.getMessagesByUID(startUid, UIDFolder.MAXUID).mapNotNull { message ->
|
folder.getMessagesByUID(startUid, UIDFolder.MAXUID).mapNotNull { message ->
|
||||||
async(coroutineDispatcher) {
|
async(coroutineDispatcher) {
|
||||||
try {
|
try {
|
||||||
getEmail(message, status)
|
getEmail(message, status)
|
||||||
} catch (e: Throwable) {
|
} catch (e: Throwable) {
|
||||||
log.error(e) { "Could not get email $message" }
|
log.error(e) { "Could not get email $message" }
|
||||||
status.addError(FetchEmailsErrorType.GetEmail, message, e)
|
status.addError(FetchEmailsErrorType.GetEmail, message, e)
|
||||||
null
|
null
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.awaitAll()
|
}
|
||||||
.filterNotNull()
|
.awaitAll()
|
||||||
}.await()
|
.filterNotNull()
|
||||||
}
|
}
|
||||||
|
|
||||||
protected open fun getEmail(message: Message, status: FetchEmailsStatus): Email? {
|
protected open fun getEmail(message: Message, status: FetchEmailsStatus): Email? {
|
||||||
|
|
Loading…
Reference in New Issue