@ -43,6 +43,12 @@ public class OfficePluginManager {
|
|||||||
@Value("${office.plugin.task.timeout:5m}")
|
@Value("${office.plugin.task.timeout:5m}")
|
||||||
private String timeOut;
|
private String timeOut;
|
||||||
|
|
||||||
|
@Value("${office.plugin.task.taskexecutiontimeout:5m}")
|
||||||
|
private String taskExecutionTimeout;
|
||||||
|
|
||||||
|
@Value("${office.plugin.task.maxtasksperprocess:5}")
|
||||||
|
private int maxTasksPerProcess;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 启动Office组件进程
|
* 启动Office组件进程
|
||||||
*/
|
*/
|
||||||
@ -60,10 +66,13 @@ public class OfficePluginManager {
|
|||||||
String[] portsString = serverPorts.split(",");
|
String[] portsString = serverPorts.split(",");
|
||||||
int[] ports = Arrays.stream(portsString).mapToInt(Integer::parseInt).toArray();
|
int[] ports = Arrays.stream(portsString).mapToInt(Integer::parseInt).toArray();
|
||||||
long timeout = DurationStyle.detectAndParse(timeOut).toMillis();
|
long timeout = DurationStyle.detectAndParse(timeOut).toMillis();
|
||||||
|
long taskexecutiontimeout = DurationStyle.detectAndParse(taskExecutionTimeout).toMillis();
|
||||||
officeManager = LocalOfficeManager.builder()
|
officeManager = LocalOfficeManager.builder()
|
||||||
.officeHome(officeHome)
|
.officeHome(officeHome)
|
||||||
.portNumbers(ports)
|
.portNumbers(ports)
|
||||||
.processTimeout(timeout)
|
.processTimeout(timeout)
|
||||||
|
.maxTasksPerProcess(maxTasksPerProcess)
|
||||||
|
.taskExecutionTimeout(taskexecutiontimeout)
|
||||||
.build();
|
.build();
|
||||||
officeManager.start();
|
officeManager.start();
|
||||||
InstalledOfficeManagerHolder.setInstance(officeManager);
|
InstalledOfficeManagerHolder.setInstance(officeManager);
|
||||||
|
|||||||
Reference in New Issue
Block a user