From bd0f910f1bdbb8ff29eb4282dac61ca33f06dbcc Mon Sep 17 00:00:00 2001 From: Ricardo Carneiro Date: Sun, 22 Dec 2024 22:18:13 -0300 Subject: [PATCH] fix: ajustes --- Services/Bot/ActionCreateCall.cs | 2 ++ Services/ResponseService/ResponseBotRHService.cs | 2 +- appsettings.Development.json | 4 ++-- appsettings.json | 4 ++-- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Services/Bot/ActionCreateCall.cs b/Services/Bot/ActionCreateCall.cs index 865460c..dcfdf7a 100644 --- a/Services/Bot/ActionCreateCall.cs +++ b/Services/Bot/ActionCreateCall.cs @@ -20,6 +20,7 @@ namespace ChatApi.Services.Bot public Task> Call() { var httpClient =_httpClientFactory.CreateClient(); + httpClient.Timeout = TimeSpan.FromSeconds(120); var url = new Uri(new Uri(_configuration.Url), _configuration.Create); var request = new HttpRequestMessage(HttpMethod.Post, url); request.Content = new StringContent(System.Text.Json.JsonSerializer.Serialize(_callRH), Encoding.UTF8, "application/json"); @@ -35,6 +36,7 @@ namespace ChatApi.Services.Bot try { errorContent = response.Content.ReadAsStringAsync().Result; + if (errorContent.ToLower().Contains("timeout")) errorContent = "O servidor do pipefy demorou um pouco para responder. Verifique se a solicitação foi aberta em seu email!"; } catch (Exception ex) { diff --git a/Services/ResponseService/ResponseBotRHService.cs b/Services/ResponseService/ResponseBotRHService.cs index 5af20e5..0a04ecb 100644 --- a/Services/ResponseService/ResponseBotRHService.cs +++ b/Services/ResponseService/ResponseBotRHService.cs @@ -70,7 +70,7 @@ namespace ChatApi.Services.ResponseService } else { - resp = "Quero abrir um anova solicitação ao RH."; + resp = "Quero abrir uma nova solicitação ao RH."; await GetResponse(context, userData, sessionId, resp, true); } diff --git a/appsettings.Development.json b/appsettings.Development.json index 0f2755a..0ab390b 100644 --- a/appsettings.Development.json +++ b/appsettings.Development.json @@ -1,13 +1,13 @@ { "DomvsDatabase": { - "ConnectionString": "mongodb://localhost:27017", + "ConnectionString": "mongodb+srv://rrcgoncalves:zSYxeWCcY7QlmAmF@cluster0.bmjlo.mongodb.net/?authMechanism=DEFAULT", "DatabaseName": "DomvsSites", "SharepointCollectionName": "SharepointSite", "ChatBotRHCollectionName": "ChatBotRHData", "ClassifierCollectionName": "ClassifierData" }, "ChatRHSettings": { - "Url": "https://localhost:7070/", + "Url": "http://localhost:8070/", "Create": "/CallRH" }, "Logging": { diff --git a/appsettings.json b/appsettings.json index b0af89b..6187534 100644 --- a/appsettings.json +++ b/appsettings.json @@ -1,6 +1,6 @@ { "DomvsDatabase": { - "ConnectionString": "mongodb://localhost:27017", + "ConnectionString": "mongodb+srv://rrcgoncalves:zSYxeWCcY7QlmAmF@cluster0.bmjlo.mongodb.net/?authMechanism=DEFAULT", "DatabaseName": "DomvsSites", "SharepointCollectionName": "SharepointSite", "ChatBotRHCollectionName": "ChatBotRHData", @@ -8,7 +8,7 @@ "UserDataName": "UserData" }, "ChatRHSettings": { - "Url": "mongodb://localhost:27017", + "Url": "http://localhost:8070/", "Create": "DomvsSites" }, "Logging": {