This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/servicecomb-pack.git


The following commit(s) were added to refs/heads/master by this push:
     new 1c3e689  SCB-1421 The RefreshTimer class periodically refreshes the 
data in the queue to the ES and clears the queue.
1c3e689 is described below

commit 1c3e689beaea2ad762f6bd05d7188760969b9e8b
Author: Lei Zhang <[email protected]>
AuthorDate: Tue Aug 6 16:56:57 2019 +0800

    SCB-1421 The RefreshTimer class periodically refreshes the data in the 
queue to the ES and clears the queue.
---
 .../repository/elasticsearch/ElasticsearchTransactionRepository.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/alpha/alpha-fsm/src/main/java/org/apache/servicecomb/pack/alpha/fsm/repository/elasticsearch/ElasticsearchTransactionRepository.java
 
b/alpha/alpha-fsm/src/main/java/org/apache/servicecomb/pack/alpha/fsm/repository/elasticsearch/ElasticsearchTransactionRepository.java
index 8625ef2..45510e4 100644
--- 
a/alpha/alpha-fsm/src/main/java/org/apache/servicecomb/pack/alpha/fsm/repository/elasticsearch/ElasticsearchTransactionRepository.java
+++ 
b/alpha/alpha-fsm/src/main/java/org/apache/servicecomb/pack/alpha/fsm/repository/elasticsearch/ElasticsearchTransactionRepository.java
@@ -85,7 +85,6 @@ public class ElasticsearchTransactionRepository implements 
TransactionRepository
       synchronized (lock) {
         save(begin);
         batchSizeCounter = 0;
-        queries.clear();
       }
     }
   }
@@ -176,6 +175,7 @@ public class ElasticsearchTransactionRepository implements 
TransactionRepository
     metricsService.metrics().doRepositoryAccepted(queries.size());
     long end = System.currentTimeMillis();
     metricsService.metrics().doRepositoryAvgTime((end - begin) / 
queries.size());
+    queries.clear();
     LOG.info("save queries={}, received={}, 
accepted={}",queries.size(),metricsService.metrics().getRepositoryReceived(),metricsService.metrics().getRepositoryAccepted());
   }
 

Reply via email to