Skip to content

Commit

Permalink
test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
TynerGjs committed Apr 16, 2024
1 parent 3914445 commit e7ed124
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@

import java.util.Iterator;
import java.util.List;
import java.util.Optional;
import java.util.Set;

public class JobInstanceProcessor {
Expand Down Expand Up @@ -101,10 +102,14 @@ public void process() {
triggerGatedExecutions(theInstance, jobDefinition);

if (theInstance.hasGatedStep() && theInstance.isRunning()) {
JobInstance updatedInstance =
myJobPersistence.fetchInstance(theInstance.getInstanceId()).orElseThrow();
Optional<JobInstance> updatedInstance = myJobPersistence.fetchInstance(theInstance.getInstanceId());

if (updatedInstance.isEmpty()){
return;
}

JobWorkCursor<?, ?, ?> jobWorkCursor = JobWorkCursor.fromJobDefinitionAndRequestedStepId(
jobDefinition, updatedInstance.getCurrentGatedStepId());
jobDefinition, updatedInstance.get().getCurrentGatedStepId());
if (jobWorkCursor.isReductionStep()) {
// Reduction step work chunks should never be sent to the queue but to its specific service instead.
triggerReductionStep(theInstance, jobWorkCursor);
Expand Down

0 comments on commit e7ed124

Please sign in to comment.