Rework escape hatch to error
This commit is contained in:
parent
0d90bbcc9c
commit
3068fe8c1a
|
@ -31,7 +31,6 @@ import ca.uhn.fhir.jpa.empi.svc.EmpiChannelSubmitterSvcImpl;
|
|||
import ca.uhn.fhir.jpa.empi.svc.EmpiPersonDeletingSvc;
|
||||
import ca.uhn.fhir.jpa.empi.svc.EmpiSearchParamSvc;
|
||||
import ca.uhn.fhir.jpa.subscription.channel.api.IChannelFactory;
|
||||
import ca.uhn.fhir.jpa.subscription.channel.subscription.IChannelNamer;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
|
@ -66,8 +65,8 @@ public class EmpiSubmitterConfig {
|
|||
|
||||
@Bean
|
||||
@Lazy
|
||||
IEmpiChannelSubmitterSvc empiChannelSubmitterSvc(IChannelNamer theChannelNamer, FhirContext theFhirContext, IChannelFactory theChannelFactory) {
|
||||
return new EmpiChannelSubmitterSvcImpl(theChannelNamer, theFhirContext, theChannelFactory);
|
||||
IEmpiChannelSubmitterSvc empiChannelSubmitterSvc(FhirContext theFhirContext, IChannelFactory theChannelFactory) {
|
||||
return new EmpiChannelSubmitterSvcImpl(theFhirContext, theChannelFactory);
|
||||
}
|
||||
|
||||
@Bean
|
||||
|
|
|
@ -65,9 +65,12 @@ public class EmpiPersonDeletingSvc {
|
|||
|
||||
IFhirResourceDao personDao = myDaoRegistry.getResourceDao("Person");
|
||||
int batchCount = 0;
|
||||
while (!deleteConflictList.isEmpty() && batchCount < MAXIMUM_DELETE_ATTEMPTS) {
|
||||
while (!deleteConflictList.isEmpty()) {
|
||||
deleteConflictBatch(deleteConflictList, personDao);
|
||||
batchCount += 1;
|
||||
if (batchCount > MAXIMUM_DELETE_ATTEMPTS) {
|
||||
throw new IllegalStateException("Person deletion seems to have entered an infinite loop. Aborting");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue