fix #1245 add jvmOptions
This commit is contained in:
parent
68fbcfc73d
commit
d9ae8cfd27
1 changed files with 25 additions and 4 deletions
|
@ -15,6 +15,7 @@
|
|||
*/
|
||||
package org.codelibs.fess.job;
|
||||
|
||||
import static org.codelibs.core.stream.StreamUtil.split;
|
||||
import static org.codelibs.core.stream.StreamUtil.stream;
|
||||
|
||||
import java.io.File;
|
||||
|
@ -55,6 +56,10 @@ public class SuggestJob {
|
|||
|
||||
protected String logLevel;
|
||||
|
||||
protected String jvmOptions;
|
||||
|
||||
protected String lastaEnv;
|
||||
|
||||
public SuggestJob jobExecutor(final JobExecutor jobExecutor) {
|
||||
this.jobExecutor = jobExecutor;
|
||||
return this;
|
||||
|
@ -80,6 +85,16 @@ public class SuggestJob {
|
|||
return this;
|
||||
}
|
||||
|
||||
public SuggestJob jvmOptions(final String option) {
|
||||
this.jvmOptions = option;
|
||||
return this;
|
||||
}
|
||||
|
||||
public SuggestJob lastaEnv(final String env) {
|
||||
this.lastaEnv = env;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String execute(final JobExecutor jobExecutor) {
|
||||
jobExecutor(jobExecutor);
|
||||
return execute();
|
||||
|
@ -169,13 +184,15 @@ public class SuggestJob {
|
|||
cmdList.add("-D" + Constants.FESS_ES_CLUSTER_NAME + "=" + fessConfig.getElasticsearchClusterName());
|
||||
}
|
||||
|
||||
final String lastaEnv = System.getProperty("lasta.env");
|
||||
if (StringUtil.isNotBlank(lastaEnv)) {
|
||||
if (lastaEnv.equals("web")) {
|
||||
final String systemLastaEnv = System.getProperty("lasta.env");
|
||||
if (StringUtil.isNotBlank(systemLastaEnv)) {
|
||||
if (systemLastaEnv.equals("web")) {
|
||||
cmdList.add("-Dlasta.env=suggest");
|
||||
} else {
|
||||
cmdList.add("-Dlasta.env=" + lastaEnv);
|
||||
cmdList.add("-Dlasta.env=" + systemLastaEnv);
|
||||
}
|
||||
} else if (StringUtil.isNotBlank(lastaEnv)) {
|
||||
cmdList.add("-Dlasta.env=" + lastaEnv);
|
||||
}
|
||||
|
||||
cmdList.add("-Dfess.suggest.process=true");
|
||||
|
@ -204,6 +221,10 @@ public class SuggestJob {
|
|||
}
|
||||
}
|
||||
|
||||
if (StringUtil.isNotBlank(jvmOptions)) {
|
||||
split(jvmOptions, " ").of(stream -> stream.filter(StringUtil::isNotBlank).forEach(s -> cmdList.add(s)));
|
||||
}
|
||||
|
||||
cmdList.add(SuggestCreator.class.getCanonicalName());
|
||||
|
||||
cmdList.add("--sessionId");
|
||||
|
|
Loading…
Add table
Reference in a new issue