Skip to content

Commit

Permalink
Merge pull request #30 from easy-lead/feat/#17
Browse files Browse the repository at this point in the history
chmod : sync 수정
  • Loading branch information
oU-Ua authored Aug 1, 2024
2 parents 55bb9d1 + 525a30a commit ae0457c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
18 changes: 11 additions & 7 deletions src/main/java/com/easylead/easylead/config/AsyncConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,21 @@
import java.util.concurrent.Executor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.AsyncConfigurer;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class AsyncConfig {
@EnableAsync
public class AsyncConfig implements AsyncConfigurer, WebMvcConfigurer {

@Bean(name = "taskExecutor1")
public Executor taskExecutor1() {
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
executor.setCorePoolSize(5);
executor.setMaxPoolSize(10);
executor.setQueueCapacity(25);
executor.setCorePoolSize(10);
executor.setMaxPoolSize(50);
executor.setQueueCapacity(100);
executor.setThreadNamePrefix("Async-");
executor.initialize();
return executor;
Expand All @@ -22,9 +26,9 @@ public Executor taskExecutor1() {
@Bean(name = "taskExecutor2")
public Executor taskExecutor2() {
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
executor.setCorePoolSize(5);
executor.setMaxPoolSize(10);
executor.setQueueCapacity(25);
executor.setCorePoolSize(10);
executor.setMaxPoolSize(50);
executor.setQueueCapacity(100);
executor.setThreadNamePrefix("Async-2-");
executor.initialize();
return executor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public JsonNode search(String title, String author, String publisher) throws Jso

HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("http://www.aladin.co.kr/ttb/api/ItemSearch.aspx?TTBKey="+aladinApiKey+
"&Query="+ encodedQuery +"&Output=JS")).build();
"&Query="+ encodedQuery +"&Output=JS&Cover=Big")).build();

log.info(query);

Expand Down Expand Up @@ -76,7 +76,7 @@ public BookInfoResDTO search(String isbn) throws JsonProcessingException {

HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("http://www.aladin.co.kr/ttb/api/ItemLookUp.aspx?TTBKey="+aladinApiKey+
"&ItemId="+ isbn +"&Output=JS")).build();
"&ItemId="+ isbn +"&Output=JS&Cover=Big")).build();


HttpClient client = HttpClient.newHttpClient();
Expand Down

0 comments on commit ae0457c

Please sign in to comment.