Remove parallelism
This commit is contained in:
parent
0d9643f8fe
commit
b5c1170d4b
@ -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)
|
||||||
}
|
}
|
||||||
|
@ -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)
|
||||||
}
|
}
|
||||||
|
@ -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)
|
||||||
|
@ -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)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user