Skip to content
Snippets Groups Projects
Verified Commit 7197d0b8 authored by Timm Fitschen's avatar Timm Fitschen
Browse files

Revert changes in Schedule.java

parent 15922b10
No related branches found
No related tags found
No related merge requests found
...@@ -31,11 +31,9 @@ class ScheduledJob { ...@@ -31,11 +31,9 @@ class ScheduledJob {
long runtime = 0; long runtime = 0;
final Job job; final Job job;
private long startTime = -1; private long startTime = -1;
private final JobExecutionTime executionTime;
public ScheduledJob(final Job j) { public ScheduledJob(final Job j) {
this.job = j; this.job = j;
this.executionTime = j.getExecutionTime();
} }
public void run() { public void run() {
...@@ -73,17 +71,12 @@ class ScheduledJob { ...@@ -73,17 +71,12 @@ class ScheduledJob {
} }
public JobExecutionTime getExecutionTime() { public JobExecutionTime getExecutionTime() {
return this.executionTime; return this.job.getExecutionTime();
} }
public boolean skip() { public boolean skip() {
return this.job.getTarget().skipJob(); return this.job.getTarget().skipJob();
} }
@Override
public String toString() {
return "SCHEDULED_" + this.job.toString();
}
} }
public class Schedule { public class Schedule {
...@@ -105,14 +98,10 @@ public class Schedule { ...@@ -105,14 +98,10 @@ public class Schedule {
public void runJobs(final JobExecutionTime time) { public void runJobs(final JobExecutionTime time) {
for (final ScheduledJob scheduledJob : this.jobs) { for (final ScheduledJob scheduledJob : this.jobs) {
try { if (scheduledJob.getExecutionTime().ordinal() == time.ordinal()
if (scheduledJob.getExecutionTime().ordinal() == time.ordinal() || (time.ordinal() <= JobExecutionTime.POST_CHECK.ordinal()
|| (time.ordinal() <= JobExecutionTime.POST_CHECK.ordinal() && scheduledJob.getExecutionTime().ordinal() < time.ordinal())) {
&& scheduledJob.getExecutionTime().ordinal() < time.ordinal())) { runJob(scheduledJob);
runJob(scheduledJob);
}
} catch (RuntimeException e) {
throw new RuntimeException(scheduledJob.toString(), e);
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment