RESOLVED - BATCH-661: broken job interruption logic
SimpleJob now checks for interrupt before starting a step
This commit is contained in:
@@ -53,7 +53,7 @@ public class SimpleJob extends AbstractJob {
|
||||
public void execute(JobExecution execution) throws JobExecutionException {
|
||||
|
||||
JobInstance jobInstance = execution.getJobInstance();
|
||||
|
||||
|
||||
StepExecution currentStepExecution = null;
|
||||
int startedCount = 0;
|
||||
List steps = getSteps();
|
||||
@@ -73,6 +73,10 @@ public class SimpleJob extends AbstractJob {
|
||||
|
||||
for (Iterator i = steps.iterator(); i.hasNext();) {
|
||||
|
||||
if (execution.getStatus() == BatchStatus.STOPPING) {
|
||||
throw new JobInterruptedException("JobExecution interrupted.");
|
||||
}
|
||||
|
||||
Step step = (Step) i.next();
|
||||
|
||||
if (shouldStart(jobInstance, step)) {
|
||||
|
||||
Reference in New Issue
Block a user