fix #1218 check if job is started
This commit is contained in:
parent
8f745f6014
commit
c14f477866
1 changed files with 5 additions and 0 deletions
|
@ -18,6 +18,7 @@ package org.codelibs.fess.es.config.exentity;
|
|||
import org.codelibs.core.lang.StringUtil;
|
||||
import org.codelibs.fess.Constants;
|
||||
import org.codelibs.fess.es.config.bsentity.BsScheduledJob;
|
||||
import org.codelibs.fess.exception.JobNotFoundException;
|
||||
import org.codelibs.fess.util.ComponentUtil;
|
||||
import org.lastaflute.job.key.LaJobUnique;
|
||||
|
||||
|
@ -56,12 +57,16 @@ public class ScheduledJob extends BsScheduledJob {
|
|||
public void start() {
|
||||
ComponentUtil.getJobManager().findJobByUniqueOf(LaJobUnique.of(getId())).ifPresent(job -> {
|
||||
job.launchNow();
|
||||
}).orElse(() -> {
|
||||
throw new JobNotFoundException(this);
|
||||
});
|
||||
}
|
||||
|
||||
public void stop() {
|
||||
ComponentUtil.getJobManager().findJobByUniqueOf(LaJobUnique.of(getId())).ifPresent(job -> {
|
||||
job.stopNow();
|
||||
}).orElse(() -> {
|
||||
throw new JobNotFoundException(this);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue