fix:1.修改filesource、undel目录执行文件时Sample延迟执行

This commit is contained in:
panbaolin 2023-10-16 16:49:50 +08:00
parent b3f5f0d276
commit 96c164cede
3 changed files with 9 additions and 8 deletions

View File

@ -56,7 +56,7 @@ public class FileSourceHandleManager{
//初始化线程池
ThreadFactory threadFactory = new CustomizableThreadFactory("filesource-file-parsing-");
poolExecutor = new ThreadPoolExecutor(taskProperties.getReceiveNum(),maximumPoolSize,5, TimeUnit.SECONDS, new LinkedBlockingQueue<>(),threadFactory);
poolExecutor = new ThreadPoolExecutor(taskProperties.getFilesourceDirReceiveNum(),maximumPoolSize,5, TimeUnit.SECONDS, new LinkedBlockingQueue<>(),threadFactory);
}
@Override
@ -71,9 +71,9 @@ public class FileSourceHandleManager{
if(!CollectionUtils.isEmpty(spectrumFiles)){
CountDownLatch taskLatch = new CountDownLatch(spectrumFiles.size());
for(File spectrumFile : spectrumFiles){
//如果是Sample谱则延迟500毫秒后执行
//如果是Sample谱则延迟2秒后执行
if(spectrumFile.getName().contains(BlockConstant.sampleFlag)){
TimeUnit.MILLISECONDS.sleep(500);
TimeUnit.SECONDS.sleep(2);
}
ParseingFileSourceThread parseingFileSourceThread = new ParseingFileSourceThread();
parseingFileSourceThread.init(spectrumFile,filePath,taskLatch);

View File

@ -67,13 +67,13 @@ public class UndealHandleManager{
//ftp解析失败文件存储路径
final String rootPath = spectrumServiceQuotes.getSpectrumPathProperties().getRootPath();
final String filePath = spectrumServiceQuotes.getSpectrumPathProperties().getUndealPath();
List<File> spectrumFiles = FileOperation.getFiles(rootPath+ File.separator+filePath,taskProperties.getFilesourceDirReceiveNum());
List<File> spectrumFiles = FileOperation.getFiles(rootPath+ File.separator+filePath,taskProperties.getUndealDirReceiveNum());
if(!CollectionUtils.isEmpty(spectrumFiles)){
CountDownLatch taskLatch = new CountDownLatch(spectrumFiles.size());
for(File spectrumFile : spectrumFiles){
//如果是Sample谱则延迟500毫秒后执行
//如果是Sample谱则延迟2秒后执行
if(spectrumFile.getName().contains(BlockConstant.sampleFlag)){
TimeUnit.MILLISECONDS.sleep(500);
TimeUnit.SECONDS.sleep(2);
}
ParseingFaliFileThread faliFileThread = new ParseingFaliFileThread();
faliFileThread.init(spectrumFile,filePath,taskLatch);

View File

@ -9,6 +9,7 @@ import org.jeecg.common.properties.SoftwareProperties;
import org.jeecg.modules.base.entity.original.GardsSampleData;
import org.jeecg.modules.base.entity.rnauto.GardsAnalyses;
import org.jeecg.modules.base.enums.AnalysesType;
import org.jeecg.modules.file.FileOperation;
import org.jeecg.modules.mapper.GardsAnalysesMapper;
import org.jeecg.modules.service.GardsAnalysesService;
import org.springframework.stereotype.Service;
@ -52,8 +53,8 @@ public class GardsAnalysesServiceImpl extends ServiceImpl<GardsAnalysesMapper, G
analyses.setUseddetphd(detSampleData.getInputFileName());
analyses.setUsedgasphdId(gasSampleData.getSampleId());
analyses.setUseddetphdId(detSampleData.getSampleId());
analyses.setLogPath(logPath);
analyses.setReportPath(reportPath);
analyses.setLogPath(FileOperation.separatorConvert(logPath));
analyses.setReportPath(FileOperation.separatorConvert(reportPath));
this.save(analyses);
return analyses;