|
1 | 1 | /*
|
2 |
| - * Copyright 2002-2023 the original author or authors. |
| 2 | + * Copyright 2002-2024 the original author or authors. |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
@@ -66,7 +66,8 @@ public class DefaultPartHttpMessageReader extends LoggingCodecSupport implements
|
66 | 66 |
|
67 | 67 | private int maxParts = -1;
|
68 | 68 |
|
69 |
| - private Scheduler blockingOperationScheduler = Schedulers.boundedElastic(); |
| 69 | + @Nullable |
| 70 | + private Scheduler blockingOperationScheduler; |
70 | 71 |
|
71 | 72 | private FileStorage fileStorage = FileStorage.tempDirectory(this::getBlockingOperationScheduler);
|
72 | 73 |
|
@@ -152,7 +153,8 @@ public void setBlockingOperationScheduler(Scheduler blockingOperationScheduler)
|
152 | 153 | }
|
153 | 154 |
|
154 | 155 | private Scheduler getBlockingOperationScheduler() {
|
155 |
| - return this.blockingOperationScheduler; |
| 156 | + return (this.blockingOperationScheduler != null ? |
| 157 | + this.blockingOperationScheduler : Schedulers.boundedElastic()); |
156 | 158 | }
|
157 | 159 |
|
158 | 160 | /**
|
@@ -206,7 +208,7 @@ public Flux<Part> read(ResolvableType elementType, ReactiveHttpInputMessage mess
|
206 | 208 | else {
|
207 | 209 | return PartGenerator.createPart(partsTokens,
|
208 | 210 | this.maxInMemorySize, this.maxDiskUsagePerPart,
|
209 |
| - this.fileStorage.directory(), this.blockingOperationScheduler); |
| 211 | + this.fileStorage.directory(), getBlockingOperationScheduler()); |
210 | 212 | }
|
211 | 213 | });
|
212 | 214 | });
|
|
0 commit comments