Skip to content

Commit

Permalink
Merge pull request #906 from Alfresco/fix/SEARCH-2390_NoTransactionsD…
Browse files Browse the repository at this point in the history
…bIdRange

SEARCH-2390: Skip getting nodes from repository when no transactions …
  • Loading branch information
aborroy authored Aug 19, 2020
2 parents 167cf41 + f03e2b4 commit 37d5fb2
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1052,7 +1052,9 @@ private void indexTransactionsAfterWorker(List<Transaction> txsIndexed)
* @throws JSONException
*/
private int indexBatchOfTransactions(List<Transaction> txBatch)
throws AuthenticationException, IOException, JSONException, ExecutionException, InterruptedException {
throws AuthenticationException, IOException, JSONException, ExecutionException, InterruptedException
{

// Skip transactions without modifications (updates, deletes)
ArrayList<Long> txIds = new ArrayList<>();
for (Transaction tx : txBatch)
Expand All @@ -1062,7 +1064,13 @@ private int indexBatchOfTransactions(List<Transaction> txBatch)
txIds.add(tx.getId());
}
}


// Skip getting nodes when no transactions left
if (txIds.size() == 0)
{
return 0;
}

// Get Nodes Id properties for every transaction
GetNodesParameters gnp = new GetNodesParameters();
gnp.setTransactionIds(txIds);
Expand Down

0 comments on commit 37d5fb2

Please sign in to comment.