refactor(通用功能): 修改停止导出任务
This commit is contained in:
parent
422456a8e2
commit
be98b48492
|
@ -38,12 +38,13 @@ public class ExportTaskManager {
|
||||||
ExportTask exportTask = buildExportTask(projectId, fileId, userId, type);
|
ExportTask exportTask = buildExportTask(projectId, fileId, userId, type);
|
||||||
ExecutorService executorService = Executors.newFixedThreadPool(1);
|
ExecutorService executorService = Executors.newFixedThreadPool(1);
|
||||||
Future<?> future = executorService.submit(() -> {
|
Future<?> future = executorService.submit(() -> {
|
||||||
while (!Thread.currentThread().isInterrupted()) {
|
if (!Thread.currentThread().isInterrupted()) {
|
||||||
// 线程任务逻辑
|
// 线程任务逻辑
|
||||||
LogUtils.info("Thread has been start.");
|
LogUtils.info("Thread has been start.");
|
||||||
selectListFunc.apply(t);
|
selectListFunc.apply(t);
|
||||||
}
|
} else {
|
||||||
LogUtils.info("Thread has been interrupted.");
|
LogUtils.info("Thread has been interrupted.");
|
||||||
|
}
|
||||||
});
|
});
|
||||||
map.put(exportTask.getId(), future);
|
map.put(exportTask.getId(), future);
|
||||||
return exportTask;
|
return exportTask;
|
||||||
|
|
Loading…
Reference in New Issue