Skip to content

Commit 262e0f3

Browse files
committed
refine: drop the unused finish() delegate
No caller remains after the outcome-typed finishOutcome() replaced the reported/empty view; keeping the one-shot delegate would let a stale caller consume the single finish and turn the response's real outcome into UNKNOWN.
1 parent ed88747 commit 262e0f3

1 file changed

Lines changed: 0 additions & 7 deletions

File tree

  • shenyu-plugin/shenyu-plugin-ai/shenyu-plugin-ai-token-limiter/src/main/java/org/apache/shenyu/plugin/ai/token/limiter

‎shenyu-plugin/shenyu-plugin-ai/shenyu-plugin-ai-token-limiter/src/main/java/org/apache/shenyu/plugin/ai/token/limiter/AiTokenLimiterPlugin.java‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@
6565
import java.util.List;
6666
import java.util.Objects;
6767
import java.util.Optional;
68-
import java.util.OptionalLong;
6968
import java.util.function.Consumer;
7069

7170
/**
@@ -430,12 +429,6 @@ synchronized void accept(final byte[] bytes) {
430429
}
431430
}
432431

433-
synchronized OptionalLong finish() {
434-
AiUsage outcome = finishOutcome();
435-
return outcome.status() == AiUsage.Status.REPORTED
436-
? OptionalLong.of(outcome.completionTokens()) : OptionalLong.empty();
437-
}
438-
439432
/**
440433
* One outcome per observed response: a reported count, or an explicitly
441434
* unavailable usage with its fixed reason — size limit, malformed data, or

0 commit comments

Comments
 (0)