Skip to content

Commit 1fdb2df

Browse files
committed
🛠️ Add exit call to terminate application after processing response to prevent hanging
1 parent 2a9656e commit 1fdb2df

File tree

1 file changed

+4
-0
lines changed
  • 02-SetupDevEnvironment/src/github-models/src/main/java/com/example/githubmodels

1 file changed

+4
-0
lines changed

02-SetupDevEnvironment/src/github-models/src/main/java/com/example/githubmodels/App.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ public static void main(String[] args) {
6262
// .message().content() gets the actual text content of the response
6363
// .orElse() provides a fallback if no content is returned
6464
System.out.println("Response: " + response.choices().get(0).message().content().orElse("No response content"));
65+
66+
// remove messages from maven threads
67+
System.exit(0);
68+
6569
} catch (Exception e) {
6670
// Handle various types of errors that might occur
6771
System.err.println("Error occurred: " + e.getMessage());

0 commit comments

Comments
 (0)