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

2
.gitignore vendored
View File

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

View File

@@ -1,17 +1,7 @@
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 static void main(String[] args) {
//TIP Press <shortcut actionId="ShowIntentionActions"/> with your caret at the highlighted text
// 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);
}
System.out.print("Manager started!");
}
}

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) {
}