Allow migration thread pool to be scaled up
This commit is contained in:
parent
be6d6351b9
commit
b75456acf3
|
@ -260,8 +260,13 @@ public class AccountsDynamoDb extends AbstractDynamoDbStore implements AccountSt
|
|||
|
||||
public CompletableFuture<Void> migrate(List<Account> accounts, int threads) {
|
||||
|
||||
migrationThreadPool.setCorePoolSize(threads);
|
||||
migrationThreadPool.setMaximumPoolSize(threads);
|
||||
if (threads > migrationThreadPool.getMaximumPoolSize()) {
|
||||
migrationThreadPool.setMaximumPoolSize(threads);
|
||||
migrationThreadPool.setCorePoolSize(threads);
|
||||
} else {
|
||||
migrationThreadPool.setCorePoolSize(threads);
|
||||
migrationThreadPool.setMaximumPoolSize(threads);
|
||||
}
|
||||
|
||||
final List<CompletableFuture<?>> futures = accounts.stream()
|
||||
.map(this::migrate)
|
||||
|
|
Loading…
Reference in New Issue