Skip to content

Commit

Permalink
Add retry on delete operation in case of concurrency exception
Browse files Browse the repository at this point in the history
  • Loading branch information
vizmay committed Oct 30, 2019
1 parent 7622bbd commit 2fbeed2
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,12 @@ public Single<Integer> execute() {
return queryProvider.delete(builder
.metaClass(metaClass)
.predicate(predicate.get())
.build());
.build())
.compose(Singles.backOffDelayRetry(
DefaultEntitySet::isConcurrencyException,
Duration.ofMillis(config.retryInitialDurationMillis()),
config.retryCount()));

}

@Override
Expand Down

0 comments on commit 2fbeed2

Please sign in to comment.