Lazy use of Reactor Scheduler in DefaultPartHttpMessageReader
Closes gh-33218
This commit is contained in:
parent
50906e7fcb
commit
39c040005e
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
* Copyright 2002-2024 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
@ -66,7 +66,8 @@ public class DefaultPartHttpMessageReader extends LoggingCodecSupport implements
|
|||
|
||||
private int maxParts = -1;
|
||||
|
||||
private Scheduler blockingOperationScheduler = Schedulers.boundedElastic();
|
||||
@Nullable
|
||||
private Scheduler blockingOperationScheduler;
|
||||
|
||||
private FileStorage fileStorage = FileStorage.tempDirectory(this::getBlockingOperationScheduler);
|
||||
|
||||
|
|
@ -152,7 +153,8 @@ public class DefaultPartHttpMessageReader extends LoggingCodecSupport implements
|
|||
}
|
||||
|
||||
private Scheduler getBlockingOperationScheduler() {
|
||||
return this.blockingOperationScheduler;
|
||||
return (this.blockingOperationScheduler != null ?
|
||||
this.blockingOperationScheduler : Schedulers.boundedElastic());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -206,7 +208,7 @@ public class DefaultPartHttpMessageReader extends LoggingCodecSupport implements
|
|||
else {
|
||||
return PartGenerator.createPart(partsTokens,
|
||||
this.maxInMemorySize, this.maxDiskUsagePerPart,
|
||||
this.fileStorage.directory(), this.blockingOperationScheduler);
|
||||
this.fileStorage.directory(), getBlockingOperationScheduler());
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue