mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2024-11-21 03:10:58 +08:00
Improve finalizedTask log
This commit is contained in:
parent
ed3a04d531
commit
7c77c317df
10
.gitignore
vendored
10
.gitignore
vendored
@ -4,7 +4,6 @@
|
||||
hs_err_pid*
|
||||
|
||||
.gradle
|
||||
.idea
|
||||
|
||||
*.lck
|
||||
*.1
|
||||
@ -19,7 +18,12 @@ NVIDIA
|
||||
/HMCL/build/
|
||||
/HMCLCore/build/
|
||||
|
||||
# idea output
|
||||
# idea
|
||||
.idea
|
||||
/out/
|
||||
/HMCL/out/
|
||||
/HMCLCore/out/
|
||||
/HMCLCore/out/
|
||||
|
||||
# eclipse
|
||||
.classpath
|
||||
.project
|
||||
|
@ -37,13 +37,13 @@ final class FinalizedTask extends Task {
|
||||
* @param pred the task that runs before succ.
|
||||
* @param callback a callback that returns the task runs after pred, succ will be executed asynchronously. You can do something that relies on the result of pred.
|
||||
*/
|
||||
public FinalizedTask(Task pred, Scheduler scheduler, FinalizedCallback callback) {
|
||||
public FinalizedTask(Task pred, Scheduler scheduler, FinalizedCallback callback, String name) {
|
||||
this.dependents = Collections.singleton(pred);
|
||||
this.scheduler = scheduler;
|
||||
this.callback = callback;
|
||||
|
||||
setSignificance(TaskSignificance.MODERATE);
|
||||
setName(callback.toString());
|
||||
setName(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -53,7 +53,6 @@ final class FinalizedTask extends Task {
|
||||
|
||||
@Override
|
||||
public void execute() throws Exception {
|
||||
setName(callback.toString());
|
||||
callback.execute(getVariables(), isDependentsSucceeded());
|
||||
|
||||
if (!isDependentsSucceeded())
|
||||
|
@ -281,7 +281,7 @@ public abstract class Task {
|
||||
}
|
||||
|
||||
public final Task finalized(Scheduler scheduler, FinalizedCallback b) {
|
||||
return new FinalizedTask(this, scheduler, b);
|
||||
return new FinalizedTask(this, scheduler, b, ReflectionHelper.getCaller().toString());
|
||||
}
|
||||
|
||||
public final <T extends Exception, K extends Exception> Task finalized(Scheduler scheduler, ExceptionalConsumer<AutoTypingMap<String>, T> success, ExceptionalConsumer<Exception, K> failure) {
|
||||
|
Loading…
Reference in New Issue
Block a user