mirror of
https://github.com/signalapp/Signal-Server.git
synced 2026-12-02 04:16:53 +00:00
Add dynamic configuration for doing a mismatch post-check
This commit is contained in:
1 parent
a51a7a0901
commit
894297efa9
3 files changed
+16
-1
No files matched your search
+7
@@ -20,6 +20,9 @@ public class DynamicAccountsDynamoDbMigrationConfiguration {
|
||||
@JsonProperty
|
||||
boolean readEnabled;
|
||||
|
||||
@JsonProperty
|
||||
boolean postCheckMismatches;
|
||||
|
||||
@JsonProperty
|
||||
boolean logMismatches;
|
||||
|
||||
@@ -70,6 +73,10 @@ public class DynamicAccountsDynamoDbMigrationConfiguration {
|
||||
return readEnabled;
|
||||
}
|
||||
|
||||
public boolean isPostCheckMismatches() {
|
||||
return postCheckMismatches;
|
||||
}
|
||||
|
||||
public boolean isLogMismatches() {
|
||||
return logMismatches;
|
||||
}
|
||||
|
||||
@@ -731,7 +731,10 @@ public class AccountsManager {
|
||||
|
||||
maybeUUid.ifPresent(uuid -> {
|
||||
|
||||
mismatchedAccounts.put(uuid);
|
||||
if (dynamicConfigurationManager.getConfiguration().getAccountsDynamoDbMigrationConfiguration()
|
||||
.isPostCheckMismatches()) {
|
||||
mismatchedAccounts.put(uuid);
|
||||
}
|
||||
|
||||
if (dynamicConfigurationManager.getConfiguration().getAccountsDynamoDbMigrationConfiguration()
|
||||
.isLogMismatches()) {
|
||||
|
||||
+5
@@ -64,6 +64,11 @@ public class MigrationMismatchedAccountsTableCrawler extends ManagedPeriodicWork
|
||||
@Override
|
||||
public void doPeriodicWork() {
|
||||
|
||||
if (!dynamicConfigurationManager.getConfiguration().getAccountsDynamoDbMigrationConfiguration()
|
||||
.isPostCheckMismatches()) {
|
||||
return;
|
||||
}
|
||||
|
||||
final List<UUID> uuids = this.mismatchedAccounts.getUuids(MAX_BATCH_SIZE);
|
||||
|
||||
final List<UUID> processedUuids = new ArrayList<>(uuids.size());
|
||||
|
||||
Reference in new issue
Block a user