Skip to content

Commit

Permalink
Merge pull request #24 from KB-iGOT/4.8.20-dev-v4
Browse files Browse the repository at this point in the history
4.8.20 dev v4
  • Loading branch information
karthik-tarento authored Jan 8, 2025
2 parents c523a8f + 89b8ebd commit 2115f80
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/main/java/com/igot/cb/pores/config/AsyncConfig.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.igot.cb.pores.config;

import com.igot.cb.pores.util.CbServerProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableAsync;
Expand All @@ -8,15 +10,16 @@
@Configuration
@EnableAsync
public class AsyncConfig {
@Autowired
private CbServerProperties cbServerProperties;

@Bean

public ThreadPoolTaskExecutor taskExecutor() {

ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
executor.setCorePoolSize(10);
executor.setMaxPoolSize(20);
executor.setQueueCapacity(500);
executor.setCorePoolSize(cbServerProperties.getAsyncThreadPoolSize());
executor.setMaxPoolSize(cbServerProperties.getAsyncThreadMaxPoolSize());
executor.setThreadNamePrefix("async-");
executor.initialize();
return executor;
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/com/igot/cb/pores/util/CbServerProperties.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,10 @@ public class CbServerProperties {
@Value("${cloud.storage.endpoint}")
private String cloudStorageEndpoint;

@Value("${async.thread.pool.size}")
private int asyncThreadPoolSize;

@Value("${async.thread.max.pool.size}")
private int asyncThreadMaxPoolSize;

}
3 changes: 3 additions & 0 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,7 @@ cloud.storage.endpoint=endpoint
discussion.cloud.folder.name=discussionhub
discussion.container.name=igot

async.thread.pool.size=10
async.thread.max.pool.size=50

accesstoken.publickey.basepath=

0 comments on commit 2115f80

Please sign in to comment.