Using try-with-resources for thread executo

This commit is contained in:
2024-11-23 18:50:42 +02:00
parent 7c9a960e11
commit e6b29e6d7c
2 changed files with 23 additions and 12 deletions

View File

@@ -53,7 +53,7 @@ public class BrokerConnector {
} catch (IOException e) {
System.err.println("Failed to send message: " + e.getMessage());
}
}, 0, 1, TimeUnit.NANOSECONDS);
}, 0, 1, TimeUnit.SECONDS);
latch.await();
scheduler.shutdown();