From 20a5c1b494d772ce375821a251798270eeb61ac3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AB=98=E9=9B=84?= Date: Tue, 2 Jan 2024 03:09:03 +0000 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9Eoffice=E8=BD=AC=E6=8D=A2=20?= =?UTF-8?q?=E8=B6=85=E6=97=B6=E5=B1=9E=E6=80=A7=E5=8A=9F=E8=83=BD=20?= =?UTF-8?q?=E6=96=B0=E5=A2=9Eoffice=E8=BD=AC=E6=8D=A2=20=E8=B6=85=E6=97=B6?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 高雄 --- .../main/java/cn/keking/service/OfficePluginManager.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/server/src/main/java/cn/keking/service/OfficePluginManager.java b/server/src/main/java/cn/keking/service/OfficePluginManager.java index 41aaee9c..1a01128f 100644 --- a/server/src/main/java/cn/keking/service/OfficePluginManager.java +++ b/server/src/main/java/cn/keking/service/OfficePluginManager.java @@ -43,6 +43,12 @@ public class OfficePluginManager { @Value("${office.plugin.task.timeout:5m}") private String timeOut; + @Value("${office.plugin.task.taskexecutiontimeout:5m}") + private String taskExecutionTimeout; + + @Value("${office.plugin.task.maxtasksperprocess:5}") + private int maxTasksPerProcess; + /** * 启动Office组件进程 */ @@ -60,10 +66,13 @@ public class OfficePluginManager { String[] portsString = serverPorts.split(","); int[] ports = Arrays.stream(portsString).mapToInt(Integer::parseInt).toArray(); long timeout = DurationStyle.detectAndParse(timeOut).toMillis(); + long taskexecutiontimeout = DurationStyle.detectAndParse(taskExecutionTimeout).toMillis(); officeManager = LocalOfficeManager.builder() .officeHome(officeHome) .portNumbers(ports) .processTimeout(timeout) + .maxTasksPerProcess(maxTasksPerProcess) + .taskExecutionTimeout(taskexecutiontimeout) .build(); officeManager.start(); InstalledOfficeManagerHolder.setInstance(officeManager);