File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
easyfile-spring-boot-starter/src/main/java/org/svnee/easyfile/starter/executor Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 2
2
3
3
import lombok .extern .slf4j .Slf4j ;
4
4
import org .springframework .core .NamedThreadLocal ;
5
+ import org .svnee .easyfile .common .constants .Constants ;
5
6
import org .svnee .easyfile .starter .executor .process .ExecuteProcessReporter ;
6
7
7
8
/**
8
9
* 执行进度探针
10
+ * 用于上报 异步下载时的进度。
11
+ * 上报需要注意:由于使用{@link ThreadLocal} 做上下文上报器的传递。所以上报要求必须在执行器当前的主线程中调用{@link #report(Integer)}上报执行。
9
12
*
10
13
* @author svnee
11
14
**/
@@ -43,12 +46,15 @@ protected static void clear() {
43
46
/**
44
47
* 上报执行进度
45
48
*
46
- * @param executeProcess 执行进度
49
+ * @param executeProcess 执行进度 数据范围(0~100)
47
50
*/
48
51
public static void report (Integer executeProcess ) {
49
52
if (executeProcess <= 0 || CURRENT_REPORTER .get () == null ) {
50
53
return ;
51
54
}
55
+ if (executeProcess > Constants .FULL_PROCESS ) {
56
+ executeProcess = Constants .FULL_PROCESS ;
57
+ }
52
58
CURRENT_REPORTER .get ().report (executeProcess );
53
59
}
54
60
You can’t perform that action at this time.
0 commit comments