Skip to content

Commit 8609539

Browse files
author
svnee
committed
feat(EasyFile): add doc
1 parent 6a8af86 commit 8609539

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

easyfile-spring-boot-starter/src/main/java/org/svnee/easyfile/starter/executor/ExecuteProcessProbe.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@
22

33
import lombok.extern.slf4j.Slf4j;
44
import org.springframework.core.NamedThreadLocal;
5+
import org.svnee.easyfile.common.constants.Constants;
56
import org.svnee.easyfile.starter.executor.process.ExecuteProcessReporter;
67

78
/**
89
* 执行进度探针
10+
* 用于上报 异步下载时的进度。
11+
* 上报需要注意:由于使用{@link ThreadLocal} 做上下文上报器的传递。所以上报要求必须在执行器当前的主线程中调用{@link #report(Integer)}上报执行。
912
*
1013
* @author svnee
1114
**/
@@ -43,12 +46,15 @@ protected static void clear() {
4346
/**
4447
* 上报执行进度
4548
*
46-
* @param executeProcess 执行进度
49+
* @param executeProcess 执行进度 数据范围(0~100)
4750
*/
4851
public static void report(Integer executeProcess) {
4952
if (executeProcess <= 0 || CURRENT_REPORTER.get() == null) {
5053
return;
5154
}
55+
if (executeProcess > Constants.FULL_PROCESS) {
56+
executeProcess = Constants.FULL_PROCESS;
57+
}
5258
CURRENT_REPORTER.get().report(executeProcess);
5359
}
5460

0 commit comments

Comments
 (0)