From e730349f8debc2219b700b4d2d9ec4f1a51a845e Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Mon, 16 Mar 2020 16:43:37 +0100 Subject: [PATCH] Added a sleep of 3 milliseconds to slow down the record read so mitigate the overload on couchbase --- .../org/gcube/accounting/aggregator/aggregation/Aggregator.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/org/gcube/accounting/aggregator/aggregation/Aggregator.java b/src/main/java/org/gcube/accounting/aggregator/aggregation/Aggregator.java index d551a89..6cf7b05 100644 --- a/src/main/java/org/gcube/accounting/aggregator/aggregation/Aggregator.java +++ b/src/main/java/org/gcube/accounting/aggregator/aggregation/Aggregator.java @@ -5,6 +5,7 @@ import java.text.DateFormat; import java.util.Calendar; import java.util.List; import java.util.UUID; +import java.util.concurrent.TimeUnit; import org.gcube.accounting.aggregator.status.AggregationState; import org.gcube.accounting.aggregator.status.AggregationStatus; @@ -236,6 +237,7 @@ public class Aggregator { for(int i=1; i<=MAX_RETRY; i++){ try { originalRecordsCounter = elaborateRow(row, aggregatorBuffer, originalRecordsCounter); + TimeUnit.MILLISECONDS.sleep(3); break; }catch (RuntimeException e) { if(i==2){