mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-12-21 05:50:18 +08:00
parent
4f39481549
commit
a0029f1df8
@ -152,10 +152,13 @@ public class Processing implements SubSystem {
|
||||
}
|
||||
|
||||
private void shutdownNonCriticalExecutor() {
|
||||
nonCriticalExecutor.shutdown();
|
||||
nonCriticalExecutor.shutdownNow();
|
||||
}
|
||||
|
||||
private void shutdownCriticalExecutor() {
|
||||
criticalExecutor.shutdown();
|
||||
try {
|
||||
if (!criticalExecutor.awaitTermination(3, TimeUnit.SECONDS)) {
|
||||
List<Runnable> criticalTasks = criticalExecutor.shutdownNow();
|
||||
logger.info(locale.get().getString(PluginLang.DISABLED_PROCESSING, criticalTasks.size()));
|
||||
for (Runnable runnable : criticalTasks) {
|
||||
@ -167,13 +170,17 @@ public class Processing implements SubSystem {
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
}
|
||||
}
|
||||
|
||||
private void ensureShutdown() {
|
||||
try {
|
||||
if (!nonCriticalExecutor.isTerminated() && !nonCriticalExecutor.awaitTermination(1, TimeUnit.SECONDS)) {
|
||||
if (!nonCriticalExecutor.isTerminated()) {
|
||||
nonCriticalExecutor.shutdownNow();
|
||||
}
|
||||
if (!criticalExecutor.isTerminated()) {
|
||||
if (!criticalExecutor.isTerminated() && !criticalExecutor.awaitTermination(1, TimeUnit.SECONDS)) {
|
||||
criticalExecutor.shutdownNow();
|
||||
}
|
||||
} catch (InterruptedException e) {
|
||||
|
Loading…
Reference in New Issue
Block a user