mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-01-28 02:54:20 +01:00
Moved static future nullification to proper finally block
This commit is contained in:
parent
1ef1910abb
commit
4dba49f241
@ -56,8 +56,12 @@ public class Analysis implements Callable<AnalysisData> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static AnalysisData runAnalysisFor(UUID serverUUID, Database database, DataCache dataCache) throws Exception {
|
public static AnalysisData runAnalysisFor(UUID serverUUID, Database database, DataCache dataCache) throws Exception {
|
||||||
future = future != null ? future : Processing.submit(new Analysis(serverUUID, database, dataCache));
|
try {
|
||||||
return future.get();
|
future = future != null ? future : Processing.submit(new Analysis(serverUUID, database, dataCache));
|
||||||
|
return future.get();
|
||||||
|
} finally {
|
||||||
|
future = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -198,7 +202,6 @@ public class Analysis implements Callable<AnalysisData> {
|
|||||||
Log.logDebug("Analysis");
|
Log.logDebug("Analysis");
|
||||||
Log.info(Locale.get(Msg.ANALYSIS_FINISHED).parse(time, ""));
|
Log.info(Locale.get(Msg.ANALYSIS_FINISHED).parse(time, ""));
|
||||||
Analysis.setServerProfile(null);
|
Analysis.setServerProfile(null);
|
||||||
future = null;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user