File tree 1 file changed +15
-15
lines changed
src/main/java/de/sldk/mc/metrics
1 file changed +15
-15
lines changed Original file line number Diff line number Diff line change @@ -33,29 +33,29 @@ public CompletableFuture<Void> collect() {
33
33
}
34
34
35
35
if (isAsyncCapable ()) {
36
- CompletableFuture .runAsync (() -> {
36
+ return CompletableFuture .runAsync (() -> {
37
37
try {
38
38
doCollect ();
39
39
} catch (Exception e ) {
40
40
logException (e );
41
41
}
42
42
});
43
- }
44
-
45
- CompletableFuture <Void > future = new CompletableFuture <>();
43
+ } else {
44
+ CompletableFuture <Void > future = new CompletableFuture <>();
46
45
47
- // don't call .get() - this blocks the ForkJoinPool.commonPool and may deadlock the server in some cases
48
- Bukkit .getScheduler ().callSyncMethod (plugin , () -> {
49
- try {
50
- doCollect ();
51
- } catch (Exception e ) {
52
- logException (e );
53
- }
54
- future .complete (null );
55
- return null ;
56
- });
46
+ // don't call .get() - this blocks the ForkJoinPool.commonPool and may deadlock the server in some cases
47
+ Bukkit .getScheduler ().callSyncMethod (plugin , () -> {
48
+ try {
49
+ doCollect ();
50
+ } catch (Exception e ) {
51
+ logException (e );
52
+ }
53
+ future .complete (null );
54
+ return null ;
55
+ });
57
56
58
- return future ;
57
+ return future ;
58
+ }
59
59
}
60
60
61
61
protected abstract void doCollect ();
You can’t perform that action at this time.
0 commit comments