mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-09-16 15:26:27 -04:00
fix: removing modpack with incomplete installation
This commit is contained in:
parent
3269841207
commit
cd9180c69a
@ -86,7 +86,7 @@ public abstract class VersionList<T extends RemoteVersion> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Task<?> loadAsync(String gameVersion) {
|
public Task<?> loadAsync(String gameVersion) {
|
||||||
return Task.composeAsync(() -> {
|
return Task.composeAsync(null, () -> {
|
||||||
lock.readLock().lock();
|
lock.readLock().lock();
|
||||||
boolean loaded;
|
boolean loaded;
|
||||||
|
|
||||||
|
@ -143,7 +143,7 @@ public class CancellableTaskExecutor extends TaskExecutor {
|
|||||||
.findAny().orElse(null);
|
.findAny().orElse(null);
|
||||||
if (!doDependentsSucceeded && task.isRelyingOnDependents() || cancelled.get()) {
|
if (!doDependentsSucceeded && task.isRelyingOnDependents() || cancelled.get()) {
|
||||||
task.setException(dependentsException);
|
task.setException(dependentsException);
|
||||||
throw new CancellationException();
|
throw new ExecutionException(dependentsException);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (doDependentsSucceeded)
|
if (doDependentsSucceeded)
|
||||||
@ -183,7 +183,7 @@ public class CancellableTaskExecutor extends TaskExecutor {
|
|||||||
if (!doDependenciesSucceeded && task.isRelyingOnDependencies()) {
|
if (!doDependenciesSucceeded && task.isRelyingOnDependencies()) {
|
||||||
Logging.LOG.severe("Subtasks failed for " + task.getName());
|
Logging.LOG.severe("Subtasks failed for " + task.getName());
|
||||||
task.setException(dependenciesException);
|
task.setException(dependenciesException);
|
||||||
throw new CancellationException();
|
throw new ExecutionException(dependenciesException);
|
||||||
}
|
}
|
||||||
|
|
||||||
flag = true;
|
flag = true;
|
||||||
|
@ -211,7 +211,7 @@ public class FileDownloadTask extends Task<Void> {
|
|||||||
Exception exception = null;
|
Exception exception = null;
|
||||||
|
|
||||||
for (int repeat = 0; repeat < retry * urls.size(); repeat++) {
|
for (int repeat = 0; repeat < retry * urls.size(); repeat++) {
|
||||||
URL url = urls.get(repeat / urls.size());
|
URL url = urls.get(repeat / retry);
|
||||||
if (isCancelled()) {
|
if (isCancelled()) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user