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) {
 | 
					  public CompletableFuture<Void> migrate(List<Account> accounts, int threads) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (threads > migrationThreadPool.getMaximumPoolSize()) {
 | 
				
			||||||
 | 
					      migrationThreadPool.setMaximumPoolSize(threads);
 | 
				
			||||||
 | 
					      migrationThreadPool.setCorePoolSize(threads);
 | 
				
			||||||
 | 
					    } else {
 | 
				
			||||||
      migrationThreadPool.setCorePoolSize(threads);
 | 
					      migrationThreadPool.setCorePoolSize(threads);
 | 
				
			||||||
      migrationThreadPool.setMaximumPoolSize(threads);
 | 
					      migrationThreadPool.setMaximumPoolSize(threads);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    final List<CompletableFuture<?>> futures = accounts.stream()
 | 
					    final List<CompletableFuture<?>> futures = accounts.stream()
 | 
				
			||||||
        .map(this::migrate)
 | 
					        .map(this::migrate)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue