Bit of clean-up, need to fix busy-waiting

This commit is contained in:
2024-11-21 23:50:59 +02:00
parent de4f2cd7b3
commit 2db49b0d5c
3 changed files with 6 additions and 18 deletions

View File

@@ -61,12 +61,8 @@ public class Main {
System.err.println("Failed to connect to RabbitMQ: " + e.getMessage());
System.err.println("Retrying in 5 seconds...");
try {
if (connection != null && connection.isOpen()) {
connection.close();
}
if (channel != null && channel.isOpen()) {
channel.close();
}
if (connection != null && connection.isOpen()) connection.close();
if (channel != null && channel.isOpen()) channel.close();
} catch (IOException | TimeoutException ignored) {
}