You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by li...@apache.org on 2018/09/05 09:51:43 UTC
[incubator-servicecomb-java-chassis] 03/03: [SCB-887]better code
This is an automated email from the ASF dual-hosted git repository.
liubao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-java-chassis.git
commit 66018624c7f2fed34adc0a3a876f4f54576ca55d
Author: liubao <ba...@huawei.com>
AuthorDate: Wed Sep 5 15:14:58 2018 +0800
[SCB-887]better code
---
.../org/apache/servicecomb/common/rest/AbstractRestInvocation.java | 6 ++----
.../apache/servicecomb/transport/highway/HighwayServerInvoke.java | 6 ++----
2 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/common/common-rest/src/main/java/org/apache/servicecomb/common/rest/AbstractRestInvocation.java b/common/common-rest/src/main/java/org/apache/servicecomb/common/rest/AbstractRestInvocation.java
index b3ec3d1..88d524a 100644
--- a/common/common-rest/src/main/java/org/apache/servicecomb/common/rest/AbstractRestInvocation.java
+++ b/common/common-rest/src/main/java/org/apache/servicecomb/common/rest/AbstractRestInvocation.java
@@ -146,10 +146,8 @@ public abstract class AbstractRestInvocation {
}
private boolean isInQueueTimeout() {
- if (System.nanoTime() - invocation.getStartTime() > CommonRestConfig.getRequestWaitInPoolTimeout() * 1_000_000) {
- return true;
- }
- return false;
+ return System.nanoTime() - invocation.getStartTime() >
+ CommonRestConfig.getRequestWaitInPoolTimeout() * 1_000_000;
}
protected void runOnExecutor() {
diff --git a/transports/transport-highway/src/main/java/org/apache/servicecomb/transport/highway/HighwayServerInvoke.java b/transports/transport-highway/src/main/java/org/apache/servicecomb/transport/highway/HighwayServerInvoke.java
index 44606f1..eee7798 100644
--- a/transports/transport-highway/src/main/java/org/apache/servicecomb/transport/highway/HighwayServerInvoke.java
+++ b/transports/transport-highway/src/main/java/org/apache/servicecomb/transport/highway/HighwayServerInvoke.java
@@ -123,10 +123,8 @@ public class HighwayServerInvoke {
}
private boolean isInQueueTimeout() {
- if (System.nanoTime() - invocation.getStartTime() > HighwayConfig.getRequestWaitInPoolTimeout() * 1_000_000) {
- return true;
- }
- return false;
+ return System.nanoTime() - invocation.getStartTime() >
+ HighwayConfig.getRequestWaitInPoolTimeout() * 1_000_000;
}
private void doRunInExecutor() throws Exception {