Added a sleep of 3 milliseconds to slow down the record read so mitigate

the overload on couchbase
This commit is contained in:
Luca Frosini 2020-03-16 16:43:37 +01:00
parent 653dd085ba
commit e730349f8d
1 changed files with 2 additions and 0 deletions

View File

@ -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){