mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-01 14:38:48 +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() {
|
||||
this.messagingManager.get().withPacketService(packetService -> {
|
||||
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);
|
||||
this.profileCache.save();
|
||||
this.profileResolver.shutdown();
|
||||
|
||||
@@ -176,14 +176,14 @@ public class MessagingManager {
|
||||
}
|
||||
|
||||
public void onShutdown() {
|
||||
if (this.scheduledExecutor != null) {
|
||||
ConcurrentUtil.shutdownExecutor(this.scheduledExecutor, TimeUnit.MILLISECONDS, 500);
|
||||
}
|
||||
if (this.packetService != null) {
|
||||
this.packetService.flushQueue();
|
||||
this.packetService.shutdown();
|
||||
}
|
||||
if (this.scheduledExecutor != null) {
|
||||
ConcurrentUtil.shutdownExecutor(this.scheduledExecutor, TimeUnit.MILLISECONDS, 500);
|
||||
}
|
||||
this.messagingService.close();
|
||||
// this.messagingService.close(); // todo - this is really slow, easier to just skip for now
|
||||
}
|
||||
|
||||
private void initMessagingService(
|
||||
|
||||
Reference in new issue
Block a user