Add dynamic configuration for doing a mismatch post-check
This commit is contained in:
parent
a51a7a0901
commit
894297efa9
|
@ -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()) {
|
||||
|
|
|
@ -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());
|
||||
|
|
Loading…
Reference in New Issue