-
Notifications
You must be signed in to change notification settings - Fork 820
Feature: 下载并发控制 #5026
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: 下载并发控制 #5026
Changes from 5 commits
4efe5b5
b89e376
194b9ac
07c4a44
c60822c
cf1e8c6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -1188,12 +1188,14 @@ public static Image newBuiltinImage(String url, double requestedWidth, double re | |||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| public static Task<Image> getRemoteImageTask(String url, int requestedWidth, int requestedHeight, boolean preserveRatio, boolean smooth) { | ||||||||||||||||||||||||||||||
| return new CacheFileTask(url) | ||||||||||||||||||||||||||||||
| .setSignificance(Task.TaskSignificance.MINOR) | ||||||||||||||||||||||||||||||
| .thenApplyAsync(file -> loadImage(file, requestedWidth, requestedHeight, preserveRatio, smooth)) | ||||||||||||||||||||||||||||||
| .setSignificance(Task.TaskSignificance.MINOR); | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| public static Task<Image> getRemoteImageTask(URI uri, int requestedWidth, int requestedHeight, boolean preserveRatio, boolean smooth) { | ||||||||||||||||||||||||||||||
| return new CacheFileTask(uri) | ||||||||||||||||||||||||||||||
| .setSignificance(Task.TaskSignificance.MINOR) | ||||||||||||||||||||||||||||||
|
Comment on lines
+1191
to
+1198
|
||||||||||||||||||||||||||||||
| .setSignificance(Task.TaskSignificance.MINOR) | |
| .thenApplyAsync(file -> loadImage(file, requestedWidth, requestedHeight, preserveRatio, smooth)) | |
| .setSignificance(Task.TaskSignificance.MINOR); | |
| } | |
| public static Task<Image> getRemoteImageTask(URI uri, int requestedWidth, int requestedHeight, boolean preserveRatio, boolean smooth) { | |
| return new CacheFileTask(uri) | |
| .setSignificance(Task.TaskSignificance.MINOR) | |
| .thenApplyAsync(file -> loadImage(file, requestedWidth, requestedHeight, preserveRatio, smooth)) | |
| .setSignificance(Task.TaskSignificance.MINOR); | |
| } | |
| public static Task<Image> getRemoteImageTask(URI uri, int requestedWidth, int requestedHeight, boolean preserveRatio, boolean smooth) { | |
| return new CacheFileTask(uri) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
setSignificance(Task.TaskSignificance.MINOR)is called twice in this chain - once after the CacheFileTask and once after thenApplyAsync. The second call (line 1193) will override the first (line 1191), making the first call redundant. Consider removing the first call or clarify if both are intentional for some reason.