mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-10-22 08:07:42 +00:00
Fixes
This commit is contained in:
1 parent
08865dc218
commit
a5270ccea8
4 files changed
+33
-9
No files matched your search
@@ -48,7 +48,12 @@ public interface Job {
|
||||
return (double) getWorkCompleted() / (double) getTotalWork();
|
||||
}
|
||||
|
||||
|
||||
default void execute(VolmitSender sender) {
|
||||
execute(sender, () -> {});
|
||||
}
|
||||
|
||||
default void execute(VolmitSender sender, Runnable whenComplete) {
|
||||
PrecisionStopwatch p = PrecisionStopwatch.start();
|
||||
CompletableFuture<?> f = J.afut(this::execute);
|
||||
int c = J.ar(() -> {
|
||||
@@ -61,6 +66,7 @@ public interface Job {
|
||||
f.whenComplete((fs, ff) -> {
|
||||
J.car(c);
|
||||
sender.sendMessage("Completed " + getName() + " in " + Form.duration(p.getMilliseconds(), 1));
|
||||
whenComplete.run();
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user