Skip to content

Commit

Permalink
chore: code re-factoring
Browse files Browse the repository at this point in the history
  • Loading branch information
astsiapanay committed Mar 14, 2024
1 parent 95c336a commit 8f25ada
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/main/java/com/epam/aidial/core/limiter/RateLimiter.java
Original file line number Diff line number Diff line change
Expand Up @@ -193,11 +193,12 @@ private Limit getLimitByUser(ProxyContext context) {
if (candidate != null) {
if (limit == null) {
limit = new Limit();
limit.setMinute(0);
limit.setDay(0);
limit.setMinute(candidate.getMinute());
limit.setDay(candidate.getDay());
} else {
limit.setMinute(Math.max(candidate.getMinute(), limit.getMinute()));
limit.setDay(Math.max(candidate.getDay(), limit.getDay()));
}
limit.setMinute(Math.max(candidate.getMinute(), limit.getMinute()));
limit.setDay(Math.max(candidate.getDay(), limit.getDay()));
}
}
return limit == null ? defaultUserLimit : limit;
Expand Down

0 comments on commit 8f25ada

Please sign in to comment.