Skip to content

Commit a3e5a07

Browse files
committed
cleanups
1 parent bb3f8a6 commit a3e5a07

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

core/sdk-core/src/main/java/software/amazon/awssdk/core/internal/async/FileAsyncRequestBodySplitHelper.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,7 @@ public void subscribe(Subscriber<? super ByteBuffer> s) {
186186
// finished successfully before onComplete. If this happens, doAfterOnComplete callback
187187
// will never be invoked, and if the current buffer is full, the publisher will stop
188188
// sending new FileAsyncRequestBody, leading to uncompleted future.
189-
.doAfterOnCancel(() -> {
190-
startNextRequestBody(simplePublisher, position);
191-
})
189+
.doAfterOnCancel(() -> startNextRequestBody(simplePublisher, position))
192190
.subscribe(s);
193191
}
194192

core/sdk-core/src/test/java/software/amazon/awssdk/core/internal/async/SplittingPublisherTestUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ public static void verifyIndividualAsyncRequestBody(SdkPublisher<AsyncRequestBod
3333
Path file,
3434
int chunkSize) throws Exception {
3535

36-
long contentLength = file.toFile().length();
3736
List<CompletableFuture<ByteBuffer>> futures = new ArrayList<>();
3837
publisher.subscribe(requestBody -> {
3938
CompletableFuture<ByteBuffer> baosFuture = new CompletableFuture<>();
@@ -48,6 +47,7 @@ public static void verifyIndividualAsyncRequestBody(SdkPublisher<AsyncRequestBod
4847
futures.add(baosFuture);
4948
}).get(5, TimeUnit.SECONDS);
5049

50+
long contentLength = file.toFile().length();
5151
Assertions.assertThat(futures.size()).isEqualTo((int) Math.ceil(contentLength / (double) chunkSize));
5252

5353
for (int i = 0; i < futures.size(); i++) {

0 commit comments

Comments
 (0)