Skip to content

Commit b02b3b0

Browse files
committed
update shutdown sequence
1 parent 55e8c16 commit b02b3b0

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/main/java/vc/Application.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,14 @@ public ScheduledExecutorService scheduledExecutorService() {
110110

111111
@PreDestroy
112112
public void onDestroy() {
113+
LOGGER.info("Shutting down Application");
113114
try {
114-
if (this.gatewayDiscordClient != null) {
115-
this.gatewayDiscordClient.logout().block();
116-
}
117115
if (this.scheduledExecutorService != null) {
118116
this.scheduledExecutorService.shutdownNow();
119117
}
118+
if (this.gatewayDiscordClient != null) {
119+
this.gatewayDiscordClient.logout().block(Duration.ofSeconds(5));
120+
}
120121
} catch (Exception e) {
121122
LOGGER.error("Error during shutdown", e);
122123
}

0 commit comments

Comments
 (0)