This commit is contained in:
leif stawnyczy 2024-07-05 11:55:48 -04:00
parent 07e90d9f4e
commit eb768b83ad
2 changed files with 8 additions and 7 deletions

View File

@ -47,7 +47,6 @@ import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import java.util.Date; import java.util.Date;
import java.util.List;
import java.util.Optional; import java.util.Optional;
import static ca.uhn.fhir.jpa.model.entity.PersistedResourceModifiedMessageEntityPK.with; import static ca.uhn.fhir.jpa.model.entity.PersistedResourceModifiedMessageEntityPK.with;

View File

@ -54,16 +54,18 @@ public class AsyncResourceModifiedSubmitterSvc {
int limit = getLimit(); int limit = getLimit();
do { do {
// we always take the 0th page, because we're deleting the elements as we process them // we always take the 0th page, because we're deleting the elements as we process them
Page<IPersistedResourceModifiedMessage> persistedResourceModifiedMsgsPage = myResourceModifiedMessagePersistenceSvc.findAllOrderedByCreatedTime( Page<IPersistedResourceModifiedMessage> persistedResourceModifiedMsgsPage =
PageRequest.of(0, limit)); myResourceModifiedMessagePersistenceSvc.findAllOrderedByCreatedTime(PageRequest.of(0, limit));
ourLog.debug( ourLog.debug(
"Attempting to submit {} resources to consumer channel.", persistedResourceModifiedMsgsPage.getTotalElements()); "Attempting to submit {} resources to consumer channel.",
persistedResourceModifiedMsgsPage.getTotalElements());
hasMoreToFetch = persistedResourceModifiedMsgsPage.hasNext(); hasMoreToFetch = persistedResourceModifiedMsgsPage.hasNext();
for (IPersistedResourceModifiedMessage persistedResourceModifiedMessage : persistedResourceModifiedMsgsPage) { for (IPersistedResourceModifiedMessage persistedResourceModifiedMessage :
boolean wasProcessed = persistedResourceModifiedMsgsPage) {
myResourceModifiedConsumer.submitPersisedResourceModifiedMessage(persistedResourceModifiedMessage); boolean wasProcessed = myResourceModifiedConsumer.submitPersisedResourceModifiedMessage(
persistedResourceModifiedMessage);
if (!wasProcessed) { if (!wasProcessed) {
// we're not fetching anymore no matter what // we're not fetching anymore no matter what