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
|
@JsonProperty
|
||||||
boolean readEnabled;
|
boolean readEnabled;
|
||||||
|
|
||||||
|
@JsonProperty
|
||||||
|
boolean postCheckMismatches;
|
||||||
|
|
||||||
@JsonProperty
|
@JsonProperty
|
||||||
boolean logMismatches;
|
boolean logMismatches;
|
||||||
|
|
||||||
|
@ -70,6 +73,10 @@ public class DynamicAccountsDynamoDbMigrationConfiguration {
|
||||||
return readEnabled;
|
return readEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isPostCheckMismatches() {
|
||||||
|
return postCheckMismatches;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isLogMismatches() {
|
public boolean isLogMismatches() {
|
||||||
return logMismatches;
|
return logMismatches;
|
||||||
}
|
}
|
||||||
|
|
|
@ -731,7 +731,10 @@ public class AccountsManager {
|
||||||
|
|
||||||
maybeUUid.ifPresent(uuid -> {
|
maybeUUid.ifPresent(uuid -> {
|
||||||
|
|
||||||
mismatchedAccounts.put(uuid);
|
if (dynamicConfigurationManager.getConfiguration().getAccountsDynamoDbMigrationConfiguration()
|
||||||
|
.isPostCheckMismatches()) {
|
||||||
|
mismatchedAccounts.put(uuid);
|
||||||
|
}
|
||||||
|
|
||||||
if (dynamicConfigurationManager.getConfiguration().getAccountsDynamoDbMigrationConfiguration()
|
if (dynamicConfigurationManager.getConfiguration().getAccountsDynamoDbMigrationConfiguration()
|
||||||
.isLogMismatches()) {
|
.isLogMismatches()) {
|
||||||
|
|
|
@ -64,6 +64,11 @@ public class MigrationMismatchedAccountsTableCrawler extends ManagedPeriodicWork
|
||||||
@Override
|
@Override
|
||||||
public void doPeriodicWork() {
|
public void doPeriodicWork() {
|
||||||
|
|
||||||
|
if (!dynamicConfigurationManager.getConfiguration().getAccountsDynamoDbMigrationConfiguration()
|
||||||
|
.isPostCheckMismatches()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
final List<UUID> uuids = this.mismatchedAccounts.getUuids(MAX_BATCH_SIZE);
|
final List<UUID> uuids = this.mismatchedAccounts.getUuids(MAX_BATCH_SIZE);
|
||||||
|
|
||||||
final List<UUID> processedUuids = new ArrayList<>(uuids.size());
|
final List<UUID> processedUuids = new ArrayList<>(uuids.size());
|
||||||
|
|
Loading…
Reference in New Issue