Add retry configuration to RemoveExpiredAccountsCommand
This commit is contained in:
parent
e12ba6b15b
commit
3591e6bebd
|
@ -20,6 +20,7 @@ import org.whispersystems.textsecuregcm.storage.Account;
|
|||
import org.whispersystems.textsecuregcm.storage.AccountsManager;
|
||||
import reactor.core.publisher.Mono;
|
||||
import reactor.core.publisher.Flux;
|
||||
import reactor.util.retry.Retry;
|
||||
|
||||
public class RemoveExpiredAccountsCommand extends AbstractSinglePassCrawlAccountsCommand {
|
||||
|
||||
|
@ -70,6 +71,7 @@ public class RemoveExpiredAccountsCommand extends AbstractSinglePassCrawlAccount
|
|||
|
||||
return deleteAccountMono
|
||||
.doOnSuccess(ignored -> deletedAccountCounter.increment())
|
||||
.retryWhen(Retry.backoff(8, Duration.ofSeconds(1)).maxBackoff(Duration.ofSeconds(4)))
|
||||
.onErrorResume(throwable -> {
|
||||
log.warn("Failed to delete account {}", expiredAccount.getUuid(), throwable);
|
||||
return Mono.empty();
|
||||
|
|
Loading…
Reference in New Issue