Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-1161 550890b87 -> c92efc3fc


review


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/c92efc3f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/c92efc3f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/c92efc3f

Branch: refs/heads/ignite-1161
Commit: c92efc3fc4f44690c7136b3d036f362f24f946e7
Parents: 550890b
Author: Yakov Zhdanov <yzhda...@gridgain.com>
Authored: Fri Jul 31 13:22:53 2015 +0300
Committer: Yakov Zhdanov <yzhda...@gridgain.com>
Committed: Fri Jul 31 13:22:53 2015 +0300

----------------------------------------------------------------------
 .../rest/handlers/query/QueryCommandHandler.java          | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c92efc3f/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/query/QueryCommandHandler.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/query/QueryCommandHandler.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/query/QueryCommandHandler.java
index f845456..a6a4c5c 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/query/QueryCommandHandler.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/query/QueryCommandHandler.java
@@ -64,17 +64,14 @@ public class QueryCommandHandler extends 
GridRestCommandHandlerAdapter {
 
         ctx.timeout().schedule(new Runnable() {
             @Override public void run() {
-                long time = System.currentTimeMillis();
+                long time = U.currentTimeMillis();
 
                 for (Map.Entry<Long, GridTuple3<QueryCursor, Iterator, Long>> 
e : qryCurs.entrySet()) {
                     synchronized (e.getValue()) {
                         long createTime = e.getValue().get3();
 
-                        if (createTime + idleQryCurTimeout > time) {
+                        if (createTime + idleQryCurTimeout > time && 
qryCurs.remove(e.getKey(), e.getValue()))
                             e.getValue().get1().close();
-
-                            qryCurs.remove(e.getKey());
-                        }
                     }
                 }
             }
@@ -161,8 +158,7 @@ public class QueryCommandHandler extends 
GridRestCommandHandlerAdapter {
 
                 Iterator cur = qryCur.iterator();
 
-                GridTuple3<QueryCursor, Iterator, Long> val =
-                    new GridTuple3<>(qryCur, cur, System.currentTimeMillis());
+                GridTuple3<QueryCursor, Iterator, Long> val = new 
GridTuple3<>(qryCur, cur, U.currentTimeMillis());
 
                 synchronized (val) {
                     qryCurs.put(qryId, val);

Reply via email to