From e552bd5a2f1b8376822c64da46f137f67e1c81f8 Mon Sep 17 00:00:00 2001 From: Yinnii Date: Fri, 4 Oct 2024 15:48:27 +0200 Subject: [PATCH] add a delay --- .../services/openAIService/OpenAIServiceController.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/openai-service/src/main/java/services/openAIService/OpenAIServiceController.java b/openai-service/src/main/java/services/openAIService/OpenAIServiceController.java index 3a5953c..370dbe6 100644 --- a/openai-service/src/main/java/services/openAIService/OpenAIServiceController.java +++ b/openai-service/src/main/java/services/openAIService/OpenAIServiceController.java @@ -636,6 +636,13 @@ public ResponseEntity biwibot(HttpServletRequest req, @RequestBody J .build(); // Send the request HttpResponse respond = httpClient.send(httpRequest, HttpResponse.BodyHandlers.ofString()); + + try { + Thread.sleep(2500); + } catch (InterruptedException e) { + e.printStackTrace(); + } + int responseCode = respond.statusCode(); if (responseCode == HttpURLConnection.HTTP_OK) { System.out.println("Response from service: " + respond.body());