Skip to content

Commit

Permalink
Replace RpcStatus to count (#2984) (#3636)
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniela Marques de Morais authored and zonghaishang committed Mar 12, 2019
1 parent 1f193b9 commit dc04701
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcExcept
String methodName = invocation.getMethodName();
int max = invoker.getUrl().getMethodParameter(methodName, Constants.ACTIVES_KEY, 0);
RpcStatus count = RpcStatus.getStatus(invoker.getUrl(), invocation.getMethodName());
if (!RpcStatus.beginCount(url, methodName, max)) {
if (!count.beginCount(url, methodName, max)) {
long timeout = invoker.getUrl().getMethodParameter(invocation.getMethodName(), Constants.TIMEOUT_KEY, 0);
long start = System.currentTimeMillis();
long remain = timeout;
synchronized (count) {
while (!RpcStatus.beginCount(url, methodName, max)) {
while (!count.beginCount(url, methodName, max)) {
try {
count.wait(remain);
} catch (InterruptedException e) {
Expand All @@ -79,7 +79,7 @@ public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcExcept
isSuccess = false;
throw t;
} finally {
RpcStatus.endCount(url, methodName, System.currentTimeMillis() - begin, isSuccess);
count.endCount(url, methodName, System.currentTimeMillis() - begin, isSuccess);
if (max > 0) {
synchronized (count) {
count.notifyAll();
Expand Down

0 comments on commit dc04701

Please sign in to comment.