Remove parallelism

This commit is contained in:
Julian Raufelder 2021-11-16 12:07:06 +01:00
parent 0d9643f8fe
commit b5c1170d4b
No known key found for this signature in database
GPG Key ID: 17EE71F6634E381D
4 changed files with 2 additions and 8 deletions

View File

@ -37,7 +37,6 @@ import java.nio.charset.StandardCharsets
import java.util.UUID import java.util.UUID
import java.util.function.Supplier import java.util.function.Supplier
import java.util.regex.Pattern import java.util.regex.Pattern
import kotlin.streams.toList
import timber.log.Timber import timber.log.Timber
open class CryptoImplVaultFormat7 : CryptoImplDecorator { open class CryptoImplVaultFormat7 : CryptoImplDecorator {
@ -156,7 +155,6 @@ open class CryptoImplVaultFormat7 : CryptoImplDecorator {
} }
return ciphertextNodes return ciphertextNodes
.parallelStream()
.map { node -> .map { node ->
ciphertextToCleartextNode(cryptoFolder, dirId, node) ciphertextToCleartextNode(cryptoFolder, dirId, node)
} }

View File

@ -126,7 +126,6 @@ internal class CryptoImplVaultFormatPre7(
return cloudContentRepository return cloudContentRepository
.list(lvl2Dir) .list(lvl2Dir)
.filterIsInstance<CloudFile>() .filterIsInstance<CloudFile>()
.parallelStream()
.map { node -> .map { node ->
ciphertextToCleartextNode(cryptoFolder, dirId, node) ciphertextToCleartextNode(cryptoFolder, dirId, node)
} }

View File

@ -98,7 +98,7 @@ internal class DropboxImpl(cloud: DropboxCloud, context: Context) {
@Throws(AuthenticationException::class, DbxException::class) @Throws(AuthenticationException::class, DbxException::class)
fun list(folder: DropboxFolder): List<DropboxNode> { fun list(folder: DropboxFolder): List<DropboxNode> {
val result: MutableList<DropboxNode> = ArrayList() val result = ArrayList<DropboxNode>()
var listFolderResult: ListFolderResult? = null var listFolderResult: ListFolderResult? = null
do { do {
listFolderResult = if (listFolderResult == null) { listFolderResult = if (listFolderResult == null) {
@ -106,7 +106,7 @@ internal class DropboxImpl(cloud: DropboxCloud, context: Context) {
} else { } else {
client().files().listFolderContinue(listFolderResult.cursor) client().files().listFolderContinue(listFolderResult.cursor)
} }
listFolderResult.entries.parallelStream().forEach { listFolderResult.entries.forEach {
result.add(from(folder, it)) result.add(from(folder, it))
} }
} while (listFolderResult?.hasMore == true) } while (listFolderResult?.hasMore == true)

View File

@ -39,7 +39,6 @@ import java.io.File
import java.io.IOException import java.io.IOException
import java.io.OutputStream import java.io.OutputStream
import java.util.Date import java.util.Date
import java.util.stream.Collectors
import okio.BufferedSink import okio.BufferedSink
import okio.BufferedSource import okio.BufferedSource
import okio.source import okio.source
@ -115,9 +114,7 @@ internal class PCloudImpl(context: Context, cloud: PCloud) {
.listFolder(path) .listFolder(path)
.execute() .execute()
.children() .children()
.parallelStream()
.map { node -> PCloudNodeFactory.from(folder, node) } .map { node -> PCloudNodeFactory.from(folder, node) }
.collect(Collectors.toList())
} catch (ex: ApiError) { } catch (ex: ApiError) {
handleApiError(ex, folder.name) handleApiError(ex, folder.name)
throw FatalBackendException(ex) throw FatalBackendException(ex)