mirror of
https://github.com/hapifhir/hapi-fhir.git
synced 2025-02-17 02:15:22 +00:00
Lazy load executor so that tests work safely.
This commit is contained in:
parent
c9f5dfd6d3
commit
b1515b5963
@ -174,6 +174,9 @@ public abstract class BaseTransactionProcessor {
|
||||
@PostConstruct
|
||||
public void start() {
|
||||
ourLog.trace("Starting transaction processor");
|
||||
}
|
||||
public TaskExecutor getTaskExecutor() {
|
||||
if (myExecutor == null) {
|
||||
if (myDaoConfig.getBundleBatchPoolSize() > 1) {
|
||||
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
|
||||
executor.setThreadNamePrefix("bundle_batch_");
|
||||
@ -188,6 +191,8 @@ public abstract class BaseTransactionProcessor {
|
||||
myExecutor = executor;
|
||||
}
|
||||
}
|
||||
return myExecutor;
|
||||
}
|
||||
|
||||
public <BUNDLE extends IBaseBundle> BUNDLE transaction(RequestDetails theRequestDetails, BUNDLE theRequest, boolean theNestedMode) {
|
||||
if (theRequestDetails != null && theRequestDetails.getServer() != null && myDao != null) {
|
||||
@ -354,7 +359,7 @@ public abstract class BaseTransactionProcessor {
|
||||
for (int i=0; i<requestEntriesSize; i++ ) {
|
||||
nextRequestEntry = requestEntries.get(i);
|
||||
BundleTask bundleTask = new BundleTask(completionLatch, theRequestDetails, responseMap, i, nextRequestEntry, theNestedMode);
|
||||
myExecutor.execute(bundleTask);
|
||||
getTaskExecutor().execute(bundleTask);
|
||||
}
|
||||
|
||||
// waiting for all tasks to be completed
|
||||
|
Loading…
x
Reference in New Issue
Block a user