damonxue opened a new issue, #3357:
URL: https://github.com/apache/incubator-shenyu/issues/3357
### Is there an existing issue for this?
- [X] I have searched the existing issues
### Current Behavior
@see org.apache.shenyu.loadbalancer.cache.UpstreamCheckTask#check(Map)
the `futures.add(future);` just to `waitFinish()` forEach then clear();
took twice O(n).
### Expected Behavior
use ComplatableFuture.thenAcceptAsync()
```java
CompletableFuture.supplyAsync(() -> check(key, upstream), executor)
.thenAcceptAsync(this::putEntityToMap);
```
### Steps To Reproduce
_No response_
### Environment
```markdown
ShenYu version(2.4.3):
```
### Debug logs
maybe unnessary forEach future, just ComplatableFuture.thenAcceptAsync
### Anything else?
_No response_
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]