Skip to content

Commit

Permalink
Increase capacity for thread pool queue at ExportJsonFilesService
Browse files Browse the repository at this point in the history
One seed node using the ExportJsonFilesService had RejectedExecutionExceptions as before we had only permitted a thread pool queue capacity of 1.

Signed-off-by: HenrikJannsen <[email protected]>
  • Loading branch information
HenrikJannsen committed Dec 28, 2022
1 parent 4c237dc commit 5ff7be9
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.stream.Collectors;

import lombok.extern.slf4j.Slf4j;
Expand All @@ -63,8 +64,7 @@ public class ExportJsonFilesService implements DaoSetupService {
private final File storageDir;
private final boolean dumpBlockchainData;

private final ListeningExecutorService executor = Utilities.getListeningExecutorService("JsonExporter",
1, 1, 1200);
private final ListeningExecutorService executor;
private JsonFileManager txFileManager, txOutputFileManager, bsqStateFileManager;

@Inject
Expand All @@ -74,6 +74,9 @@ public ExportJsonFilesService(DaoStateService daoStateService,
this.daoStateService = daoStateService;
this.storageDir = storageDir;
this.dumpBlockchainData = dumpBlockchainData;

ThreadPoolExecutor threadPoolExecutor = Utilities.getThreadPoolExecutor("JsonExporter", 1, 1, 20, 60);
executor = MoreExecutors.listeningDecorator(threadPoolExecutor);
}


Expand Down

0 comments on commit 5ff7be9

Please sign in to comment.