Skip to content

Commit

Permalink
participant-integration-api: Don't copy the DAR file bytes. (digital-…
Browse files Browse the repository at this point in the history
…asset#8717)

This doesn't seem to improve performance much (probably because the
real bottleneck is elsewhere), but at the very least it's not necessary.

CHANGELOG_BEGIN
CHANGELOG_END
  • Loading branch information
SamirTalwar authored Feb 2, 2021
1 parent d6cbd86 commit c057367
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

package com.daml.platform.apiserver.services.admin

import java.io.ByteArrayInputStream
import java.time.Duration
import java.util.UUID
import java.util.zip.ZipInputStream
Expand Down Expand Up @@ -100,10 +99,9 @@ private[apiserver] final class ApiPackageManagementService private (
else
SubmissionId.assertFromString(request.submissionId)

val stream = new ZipInputStream(new ByteArrayInputStream(request.darFile.toByteArray))

val darInputStream = new ZipInputStream(request.darFile.newInput())
val response = for {
dar <- decodeAndValidate(stream).fold(
dar <- decodeAndValidate(darInputStream).fold(
err => Future.failed(ErrorFactories.invalidArgument(err.getMessage)),
Future.successful,
)
Expand Down

0 comments on commit c057367

Please sign in to comment.