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

4
.gitignore vendored
View File

@@ -4,6 +4,7 @@ target/
!**/src/test/**/target/ !**/src/test/**/target/
### IntelliJ IDEA ### ### IntelliJ IDEA ###
.idea/
**/.idea/ **/.idea/
.idea/modules.xml .idea/modules.xml
.idea/jarRepositories.xml .idea/jarRepositories.xml
@@ -36,4 +37,5 @@ build/
.vscode/ .vscode/
### Mac OS ### ### Mac OS ###
.DS_Store .DS_Store
/.idea/

View File

@@ -1,17 +1,7 @@
package io.github.lumijiez; package io.github.lumijiez;
//TIP To <b>Run</b> code, press <shortcut actionId="Run"/> or
// click the <icon src="AllIcons.Actions.Execute"/> icon in the gutter.
public class Main { public class Main {
public static void main(String[] args) { public static void main(String[] args) {
//TIP Press <shortcut actionId="ShowIntentionActions"/> with your caret at the highlighted text System.out.print("Manager started!");
// to see how IntelliJ IDEA suggests fixing it.
System.out.printf("Hello and welcome!");
for (int i = 1; i <= 5; i++) {
//TIP Press <shortcut actionId="Debug"/> to start debugging your code. We have set one <icon src="AllIcons.Debugger.Db_set_breakpoint"/> breakpoint
// for you, but you can always add more by pressing <shortcut actionId="ToggleLineBreakpoint"/>.
System.out.println("i = " + i);
}
} }
} }

View File

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