Skip to content

Conversation

laijianbin
Copy link
Contributor

No description provided.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.004%) to 86.846% when pulling 1676e16 on laijianbin:123 into a999de1 on ServiceComb:master.

TcpClientConfig tcpClientConfig = new TcpClientConfig();
tcpClientConfig.setRequestTimeoutMillis(AbstractTransport.getRequestTimeout());
DynamicLongProperty prop = AbstractTransport.getRequestTimeoutProperty();
prop.addCallback(new Runnable(){
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's better to add a comment on this line to support setup the request timeout dynamically.


private static final long DEFAULT_TIMEOUT_MILLIS = 30000;

private static final String DEFAULT_TIMEOUT_KEY = "cse.request.timeout";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change the constant to REQUEST_TIMEOUT_KEY.

ConfigUtil.installDynamicConfig();
AbstractConfiguration configuration =
(AbstractConfiguration) DynamicPropertyFactory.getBackingConfigurationSource();
configuration.addProperty("cse.request.timeout", 2000);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please using the constant value like REQUEST_TIMEOUT_KEY here.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.004%) to 86.846% when pulling 0796fea on laijianbin:123 into a999de1 on ServiceComb:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 86.88% when pulling 0796fea on laijianbin:123 into a999de1 on ServiceComb:master.

@WillemJiang WillemJiang requested a review from wujimin November 20, 2017 14:20
msRequestTimeout = msTimeout;
return msRequestTimeout;
public static DynamicLongProperty getRequestTimeoutProperty(){
return DynamicPropertyFactory.getInstance().getLongProperty(REQUEST_TIMEOUT_KEY, DEFAULT_TIMEOUT_MILLIS);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need to create the property every time.

@WillemJiang
Copy link
Member

@laijianbin There are two PR for the same issue, please close the PR which you don't want us to merge.

@laijianbin
Copy link
Contributor Author

no use

@laijianbin laijianbin closed this Nov 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants