mirror of
https://github.com/signalapp/Signal-Server.git
synced 2026-12-01 14:16:47 +00:00
Allow migration thread pool to be scaled up
This commit is contained in:
1 parent
be6d6351b9
commit
b75456acf3
1 file changed
+7
-2
+7
-2
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user