From 27f5f94c60207832eaf4b4c910e3ebd03d4e5748 Mon Sep 17 00:00:00 2001 From: Jon Chambers Date: Mon, 25 Nov 2024 10:39:08 -0500 Subject: [PATCH] Retry registration recovery password migration attempts --- .../workers/MigrateRegistrationRecoveryPasswordsCommand.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/workers/MigrateRegistrationRecoveryPasswordsCommand.java b/service/src/main/java/org/whispersystems/textsecuregcm/workers/MigrateRegistrationRecoveryPasswordsCommand.java index ff99a1bfd..9c91182d7 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/workers/MigrateRegistrationRecoveryPasswordsCommand.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/workers/MigrateRegistrationRecoveryPasswordsCommand.java @@ -18,6 +18,8 @@ import org.whispersystems.textsecuregcm.auth.SaltedTokenHash; import org.whispersystems.textsecuregcm.metrics.MetricsUtil; import org.whispersystems.textsecuregcm.storage.RegistrationRecoveryPasswordsManager; import reactor.core.publisher.Mono; +import reactor.util.retry.Retry; +import java.time.Duration; public class MigrateRegistrationRecoveryPasswordsCommand extends AbstractCommandWithDependencies { @@ -89,6 +91,7 @@ public class MigrateRegistrationRecoveryPasswordsCommand extends AbstractCommand return dryRun ? Mono.just(false) : Mono.fromFuture(() -> registrationRecoveryPasswordsManager.migrateE164Record(e164, saltedTokenHash, expiration)) + .retryWhen(Retry.backoff(3, Duration.ofSeconds(1))) .onErrorResume(throwable -> { logger.warn("Failed to migrate record for {}", e164, throwable); return Mono.empty();