diff --git a/src/main/java/uk/ac/ebi/eva/pipeline/runner/EvaPipelineJobLauncherCommandLineRunner.java b/src/main/java/uk/ac/ebi/eva/pipeline/runner/EvaPipelineJobLauncherCommandLineRunner.java index fb392cb51..37ab70b47 100644 --- a/src/main/java/uk/ac/ebi/eva/pipeline/runner/EvaPipelineJobLauncherCommandLineRunner.java +++ b/src/main/java/uk/ac/ebi/eva/pipeline/runner/EvaPipelineJobLauncherCommandLineRunner.java @@ -208,33 +208,21 @@ private Optional 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."); } }