Skip to content

Commit

Permalink
review retry
Browse files Browse the repository at this point in the history
  • Loading branch information
hexiaofeng committed May 8, 2024
1 parent 989a3d0 commit d1b50af
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import com.jd.live.agent.bootstrap.bytekit.context.MethodContext;
import com.jd.live.agent.core.plugin.definition.InterceptorAdaptor;
import com.jd.live.agent.governance.context.RequestContext;
import com.jd.live.agent.governance.context.bag.Carrier;
import com.jd.live.agent.governance.instance.Endpoint;
import com.jd.live.agent.governance.invoke.InboundInvocation;
import com.jd.live.agent.governance.invoke.InboundInvocation.GatewayInboundInvocation;
Expand All @@ -39,8 +40,6 @@
import java.util.List;
import java.util.function.Supplier;

import static com.jd.live.agent.governance.invoke.retry.Retrier.DEADLINE_KEY;

/**
* AbstractInterceptor is the base class for all interceptors within the framework.
* It provides a common context for the interception process and defines the structure
Expand Down Expand Up @@ -218,7 +217,7 @@ protected Object invokeWithRetry(O invocation, MethodContext ctx) {
if (retrier != null) {
Long timeout = retryPolicy.getTimeout();
if (timeout != null && timeout > 0) {
RequestContext.getOrCreate().setAttribute(DEADLINE_KEY, System.currentTimeMillis() + timeout);
RequestContext.getOrCreate().setAttribute(Carrier.ATTRIBUTE_DEADLINE, System.currentTimeMillis() + timeout);
}
return retrier.execute(retrySupplier);
}
Expand Down

0 comments on commit d1b50af

Please sign in to comment.