fix: list application 接口获取 app lastCommit 使用虚拟线程执行
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
package net.geedge.asw.common.config;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
|
||||
@Configuration
|
||||
public class ThreadPoolConfig {
|
||||
|
||||
@Bean
|
||||
public ExecutorService virtualThreadExecutor() {
|
||||
return Executors.newVirtualThreadPerTaskExecutor();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -26,6 +26,7 @@ import org.eclipse.jgit.treewalk.CanonicalTreeParser;
|
||||
import org.eclipse.jgit.treewalk.TreeWalk;
|
||||
import org.eclipse.jgit.treewalk.filter.PathFilter;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -33,6 +34,7 @@ import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -61,6 +63,10 @@ public class GitServiceImpl implements IGitService {
|
||||
@Autowired
|
||||
private IWorkspaceService workspaceService;
|
||||
|
||||
@Autowired
|
||||
@Qualifier("virtualThreadExecutor")
|
||||
private ExecutorService virtualThreadExecutor;
|
||||
|
||||
/**
|
||||
* is binary file
|
||||
*
|
||||
@@ -289,7 +295,7 @@ public class GitServiceImpl implements IGitService {
|
||||
log.warn(e);
|
||||
}
|
||||
return T.MapUtil.newHashMap();
|
||||
})
|
||||
}, this.virtualThreadExecutor)
|
||||
);
|
||||
|
||||
resultList.add(m);
|
||||
|
||||
Reference in New Issue
Block a user