Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EPMRPP-88955 || increase thread executor pool size #1907

Closed
wants to merge 7 commits into from
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ dependencies {
implementation 'com.epam.reportportal:plugin-api'
} else {
implementation 'com.github.reportportal:commons-events:e337f8b7be'
implementation 'com.github.reportportal:commons-dao:516ace3'
implementation 'com.github.reportportal:commons-dao:9941604'
implementation 'com.github.reportportal:commons-rules:01ec4d17'
implementation 'com.github.reportportal:commons-model:3251388'
implementation 'com.github.reportportal:commons:07566b8e'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

import com.epam.reportportal.commons.template.TemplateEngine;
import com.epam.reportportal.commons.template.TemplateEngineProvider;
import com.epam.ta.reportportal.core.analyzer.strategy.LaunchAnalysisStrategy;
import com.epam.ta.reportportal.util.email.strategy.EmailNotificationStrategy;
import com.epam.ta.reportportal.util.email.strategy.EmailTemplate;
import com.epam.ta.reportportal.util.email.strategy.UserDeletionNotificationStrategy;
Expand All @@ -27,14 +26,15 @@
import com.google.common.collect.ImmutableMap;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;

/**
* Global Email Configuration<br> Probably will be replaces by configuration per project.
* Global Email Configuration<br> Probably will be replaced by configuration per project.
*
* @author Andrei_Ramanchuk
*/
Expand All @@ -45,11 +45,14 @@ public class EmailConfiguration {
private ApplicationContext applicationContext;

@Bean
public ThreadPoolTaskExecutor emailExecutorService() {
public ThreadPoolTaskExecutor emailExecutorService(
@Value("${rp.environment.variable.executor.pool.user-email.core}") Integer corePoolSize,
@Value("${rp.environment.variable.executor.pool.user-email.max}") Integer maxPoolSize,
@Value("${rp.environment.variable.executor.pool.user-email.queue}") Integer queueCapacity) {
ThreadPoolTaskExecutor threadPoolTaskExecutor = new ThreadPoolTaskExecutor();
threadPoolTaskExecutor.setCorePoolSize(5);
threadPoolTaskExecutor.setMaxPoolSize(20);
threadPoolTaskExecutor.setQueueCapacity(50);
threadPoolTaskExecutor.setCorePoolSize(corePoolSize);
threadPoolTaskExecutor.setMaxPoolSize(maxPoolSize);
threadPoolTaskExecutor.setQueueCapacity(queueCapacity);
threadPoolTaskExecutor.setAllowCoreThreadTimeOut(true);
threadPoolTaskExecutor.setAwaitTerminationSeconds(20);
threadPoolTaskExecutor.setThreadNamePrefix("email-sending-exec");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ public AttachDefaultPhotoEventHandler(UserRepository userRepository,
public void handleContextRefresh(ContextRefreshedEvent event) {
userRepository.findByLogin("superadmin")
.ifPresent(it -> attachPhoto(it, "image/superAdminPhoto.jpg"));
userRepository.findByLogin("default")
.ifPresent(it -> attachPhoto(it, "image/defaultUserPhoto.jpg"));
}

private void attachPhoto(User user, String photoPath) {
Expand Down
Loading
Loading