mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-03-07 17:36:52 +08:00
parent
8e28c2487f
commit
a96fe298b8
@ -277,9 +277,7 @@ public class ModUpdatesPage extends BorderPane implements DecoratorPage {
|
|||||||
dependents = mods.stream()
|
dependents = mods.stream()
|
||||||
.map(mod -> {
|
.map(mod -> {
|
||||||
return Task
|
return Task
|
||||||
.runAsync(Schedulers.javafx(), () -> {
|
.runAsync(Schedulers.javafx(), () -> mod.getKey().setOld(true))
|
||||||
mod.getKey().setOld(true);
|
|
||||||
})
|
|
||||||
.thenComposeAsync(() -> {
|
.thenComposeAsync(() -> {
|
||||||
FileDownloadTask task = new FileDownloadTask(
|
FileDownloadTask task = new FileDownloadTask(
|
||||||
new URL(mod.getValue().getFile().getUrl()),
|
new URL(mod.getValue().getFile().getUrl()),
|
||||||
@ -326,6 +324,8 @@ public class ModUpdatesPage extends BorderPane implements DecoratorPage {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute() throws Exception {
|
public void execute() throws Exception {
|
||||||
|
if (!isDependentsSucceeded())
|
||||||
|
throw getException();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -709,7 +709,7 @@ public abstract class Task<T> {
|
|||||||
@Override
|
@Override
|
||||||
public void execute() throws Exception {
|
public void execute() throws Exception {
|
||||||
if (isDependentsSucceeded() != (Task.this.getException() == null))
|
if (isDependentsSucceeded() != (Task.this.getException() == null))
|
||||||
throw new AssertionError("When whenComplete succeeded, Task.exception must be null.");
|
throw new AssertionError("When whenComplete succeeded, Task.exception must be null.", Task.this.getException());
|
||||||
|
|
||||||
action.execute(Task.this.getException());
|
action.execute(Task.this.getException());
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user