查询时copy参数 防污染

This commit is contained in:
zhou-hao 2020-09-28 15:04:20 +08:00
parent 38294f1517
commit 2a29778475
3 changed files with 6 additions and 4 deletions

View File

@ -255,8 +255,6 @@ public class ReactiveElasticSearchService implements ElasticSearchService {
.onBackpressureBuffer(bufferBackpressure,
drop -> System.err.println("无法处理更多索引请求!"),
BufferOverflowStrategy.DROP_OLDEST)
.parallel()
.runOn(Schedulers.parallel())
.flatMap(buffers -> {
long time = System.currentTimeMillis();
return this

View File

@ -113,7 +113,7 @@ public class DefaultDeviceDataService implements DeviceDataService {
@Nonnull DevicePropertyAggregation... properties) {
return this
.getStoreStrategy(productId)
.flatMapMany(strategy -> strategy.aggregationPropertiesByProduct(productId, request, properties));
.flatMapMany(strategy -> strategy.aggregationPropertiesByProduct(productId, request.copy(), properties));
}
@Override
@ -122,7 +122,7 @@ public class DefaultDeviceDataService implements DeviceDataService {
@Nonnull DevicePropertyAggregation... properties) {
return this
.getDeviceStrategy(deviceId)
.flatMapMany(strategy -> strategy.aggregationPropertiesByDevice(deviceId, request, properties));
.flatMapMany(strategy -> strategy.aggregationPropertiesByDevice(deviceId, request.copy(), properties));
}
@Nonnull

View File

@ -273,5 +273,9 @@ public interface DeviceDataService {
//过滤条件
@Schema(description = "过滤条件")
QueryParamEntity filter = QueryParamEntity.of();
public AggregationRequest copy() {
return new AggregationRequest(interval, format, from, to, limit, filter.clone());
}
}
}