Skip to content

Commit

Permalink
Merge pull request #97 from jorizci/launcher-messages-fix
Browse files Browse the repository at this point in the history
Modified job execution process to remove wrong debug messages.
  • Loading branch information
jmmut authored Feb 28, 2017
2 parents e94df1b + 20b3709 commit 6056c72
Showing 1 changed file with 7 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -208,33 +208,21 @@ private Optional<Properties> getJobParametersFromCommandLine(String[] args)
}

private void launchJob(JobParameters jobParameters) throws JobExecutionException, UnknownJobException {
executeLocalJobs(jobParameters);
executeRegisteredJobs(jobParameters);
}

private void executeLocalJobs(JobParameters jobParameters) throws JobExecutionException {
for (Job job : this.jobs) {
if (!PatternMatchUtils.simpleMatch(jobName, job.getName())) {
logger.debug("Skipped job: " + job.getName());
continue;
if (PatternMatchUtils.simpleMatch(jobName, job.getName())) {
execute(job, jobParameters);
return;
}
execute(job, jobParameters);
return;
}
}

private void executeRegisteredJobs(JobParameters jobParameters) throws JobExecutionException {
if (this.jobRegistry != null) {
try {
Job job = jobRegistry.getJob(jobName);
if (this.jobs.contains(job)) {
return;
}
execute(job, jobParameters);
return;
execute(jobRegistry.getJob(jobName), jobParameters);
} catch (NoSuchJobException ex) {
logger.debug("No job found in registry for job name: " + jobName);
logger.error("No job found in registry for job name: " + jobName);
}
} else {
logger.error("Job not found and no JobRegistry initializated.");
}
}

Expand Down

0 comments on commit 6056c72

Please sign in to comment.