From 098a23c3eceed3b934f297409284fa49f8c9e427 Mon Sep 17 00:00:00 2001 From: Aliaksandr Stsiapanay Date: Thu, 14 Mar 2024 19:14:33 +0300 Subject: [PATCH] fix: resolve PR comments --- src/main/java/com/epam/aidial/core/limiter/RateLimiter.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/com/epam/aidial/core/limiter/RateLimiter.java b/src/main/java/com/epam/aidial/core/limiter/RateLimiter.java index 180e8461d..3ad97b8e7 100644 --- a/src/main/java/com/epam/aidial/core/limiter/RateLimiter.java +++ b/src/main/java/com/epam/aidial/core/limiter/RateLimiter.java @@ -190,6 +190,7 @@ private RateLimitResult checkTokenLimit(ProxyContext context, Limit limit, long private RateLimitResult checkRequestLimit(ProxyContext context, Limit limit, long timestamp) { String tokensPath = getPathToRequests(context.getDeployment().getName()); ResourceDescription resourceDescription = getResourceDescription(context, tokensPath); + // pass array to hold rate limit result returned by the function to compute the resource RateLimitResult[] result = new RateLimitResult[1]; resourceService.computeResource(resourceDescription, json -> updateRequestLimit(json, timestamp, limit, result)); return result[0];