Skip to content

Commit

Permalink
Force shutdown of thread pool
Browse files Browse the repository at this point in the history
  • Loading branch information
rtm516 committed Aug 6, 2024
1 parent 42afb88 commit 11a05d4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import org.geysermc.geyser.api.event.connection.GeyserBedrockPingEvent;
import org.geysermc.geyser.api.event.lifecycle.GeyserDefineCommandsEvent;
import org.geysermc.geyser.api.event.lifecycle.GeyserPostInitializeEvent;
import org.geysermc.geyser.api.event.lifecycle.GeyserShutdownEvent;
import org.geysermc.geyser.api.extension.Extension;
import org.geysermc.geyser.api.util.MinecraftVersion;

Expand Down Expand Up @@ -177,6 +178,11 @@ public void onPostInitialize(GeyserPostInitializeEvent event) {
});
}

@Subscribe
public void onShutdown(GeyserShutdownEvent event) {
sessionManager.shutdown();
}

@Subscribe
public void onBedrockPing(GeyserBedrockPingEvent event) {
if (sessionInfo == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public void shutdown() {

// Shutdown self
super.shutdown();
scheduledThreadPool.shutdown();
scheduledThreadPool.shutdownNow();
}

/**
Expand Down

0 comments on commit 11a05d4

Please sign in to comment.