mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-02 22:16:22 +00:00
partially fix MessagingManager shutdown
This commit is contained in:
1 parent
a393a53a37
commit
cdb9d618f9
2 files changed
+5
-6
No files matched your search
@@ -141,9 +141,8 @@ public abstract class CarbonChatInternal<C extends CarbonPlayer> implements Carb
|
|||||||
protected void shutdown() {
|
protected void shutdown() {
|
||||||
this.messagingManager.get().withPacketService(packetService -> {
|
this.messagingManager.get().withPacketService(packetService -> {
|
||||||
packetService.queuePacket(this.injector.getInstance(PacketFactory.class).clearLocalPlayersPacket());
|
packetService.queuePacket(this.injector.getInstance(PacketFactory.class).clearLocalPlayersPacket());
|
||||||
packetService.flushQueue(); // todo remove
|
|
||||||
});
|
});
|
||||||
// this.messagingManager.get().onShutdown(); // todo fix this taking so long
|
this.messagingManager.get().onShutdown();
|
||||||
ConcurrentUtil.shutdownExecutor(this.periodicTasks, TimeUnit.MILLISECONDS, 500);
|
ConcurrentUtil.shutdownExecutor(this.periodicTasks, TimeUnit.MILLISECONDS, 500);
|
||||||
this.profileCache.save();
|
this.profileCache.save();
|
||||||
this.profileResolver.shutdown();
|
this.profileResolver.shutdown();
|
||||||
|
|||||||
@@ -176,14 +176,14 @@ public class MessagingManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void onShutdown() {
|
public void onShutdown() {
|
||||||
|
if (this.scheduledExecutor != null) {
|
||||||
|
ConcurrentUtil.shutdownExecutor(this.scheduledExecutor, TimeUnit.MILLISECONDS, 500);
|
||||||
|
}
|
||||||
if (this.packetService != null) {
|
if (this.packetService != null) {
|
||||||
this.packetService.flushQueue();
|
this.packetService.flushQueue();
|
||||||
this.packetService.shutdown();
|
this.packetService.shutdown();
|
||||||
}
|
}
|
||||||
if (this.scheduledExecutor != null) {
|
// this.messagingService.close(); // todo - this is really slow, easier to just skip for now
|
||||||
ConcurrentUtil.shutdownExecutor(this.scheduledExecutor, TimeUnit.MILLISECONDS, 500);
|
|
||||||
}
|
|
||||||
this.messagingService.close();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initMessagingService(
|
private void initMessagingService(
|
||||||
|
|||||||
Reference in new issue
Block a user