diff --git a/backend/src/main/java/io/metersphere/Application.java b/backend/src/main/java/io/metersphere/Application.java index 202977b8ff..fa5857c542 100644 --- a/backend/src/main/java/io/metersphere/Application.java +++ b/backend/src/main/java/io/metersphere/Application.java @@ -10,6 +10,7 @@ import org.springframework.boot.autoconfigure.quartz.QuartzAutoConfiguration; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.web.servlet.ServletComponentScan; import org.springframework.context.annotation.PropertySource; +import org.springframework.scheduling.annotation.EnableAsync; import org.springframework.scheduling.annotation.EnableScheduling; @SpringBootApplication(exclude = { @@ -23,6 +24,7 @@ import org.springframework.scheduling.annotation.EnableScheduling; JmeterProperties.class }) @EnableScheduling +@EnableAsync(proxyTargetClass = true) //@PropertySource(value = {"file:c:\\opt\\metersphere\\conf\\metersphere.properties"}, encoding = "UTF-8", ignoreResourceNotFound = true) @PropertySource(value = {"file:/opt/metersphere/conf/metersphere.properties"}, encoding = "UTF-8", ignoreResourceNotFound = true) public class Application { diff --git a/backend/src/main/java/io/metersphere/commons/consumer/LoadTestFinishEvent.java b/backend/src/main/java/io/metersphere/commons/consumer/LoadTestFinishEvent.java index 87eaa17d20..412ee46d07 100644 --- a/backend/src/main/java/io/metersphere/commons/consumer/LoadTestFinishEvent.java +++ b/backend/src/main/java/io/metersphere/commons/consumer/LoadTestFinishEvent.java @@ -1,7 +1,9 @@ package io.metersphere.commons.consumer; import io.metersphere.base.domain.LoadTestReport; +import org.springframework.scheduling.annotation.Async; public interface LoadTestFinishEvent { + @Async void execute(LoadTestReport loadTestReport); }