fix: actually handle stopping the database when the bot is stopping
This commit is contained in:
@@ -1 +1 @@
|
||||
1256
|
||||
1258
|
||||
@@ -148,6 +148,8 @@ public class Main {
|
||||
|
||||
executorService.shutdown();
|
||||
|
||||
database.stop();
|
||||
|
||||
try {
|
||||
final boolean ignoredExecutorDone = executor.awaitTermination(5, TimeUnit.SECONDS);
|
||||
final boolean ignoredExecutorServiceDone = executorService.awaitTermination(5, TimeUnit.SECONDS);
|
||||
|
||||
@@ -50,4 +50,14 @@ public class DatabasePlugin {
|
||||
|
||||
return statement.executeUpdate(query);
|
||||
}
|
||||
|
||||
public void stop () {
|
||||
executorService.shutdown();
|
||||
|
||||
try {
|
||||
connection.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user