diff --git a/server/src/main/java/com/defold/extender/AsyncBuilder.java b/server/src/main/java/com/defold/extender/AsyncBuilder.java index 99660409..64913e4f 100644 --- a/server/src/main/java/com/defold/extender/AsyncBuilder.java +++ b/server/src/main/java/com/defold/extender/AsyncBuilder.java @@ -83,7 +83,7 @@ private void writeExceptionToFile(Exception exception, File file) { } } - @Async + @Async(value="extenderTaskExecutor") public void asyncBuildEngine(MetricsWriter metricsWriter, String platform, String sdkVersion, File jobDirectory, File uploadDirectory, File buildDirectory) throws IOException { String jobName = jobDirectory.getName(); diff --git a/server/src/main/java/com/defold/extender/tracing/ExtenderExecutor.java b/server/src/main/java/com/defold/extender/tracing/ExtenderExecutor.java index 5e36e914..85d9f76e 100644 --- a/server/src/main/java/com/defold/extender/tracing/ExtenderExecutor.java +++ b/server/src/main/java/com/defold/extender/tracing/ExtenderExecutor.java @@ -1,5 +1,6 @@ package com.defold.extender.tracing; +import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.task.SimpleAsyncTaskExecutor; @@ -24,6 +25,9 @@ @Configuration(proxyBeanMethods = false) class ExtenderExecutor { + @Value("${extender.tasks.executor.pool-size:35}") + private int executorPoolSize; + @Configuration(proxyBeanMethods = false) @EnableAsync static class AsyncConfig implements AsyncConfigurer, WebMvcConfigurer { @@ -63,6 +67,7 @@ public ScheduledExecutorService getScheduledExecutor() throws IllegalStateExcept return ContextScheduledExecutorService.wrap(super.getScheduledExecutor()); } }; + threadPoolTaskScheduler.setPoolSize(executorPoolSize); threadPoolTaskScheduler.initialize(); return threadPoolTaskScheduler; }