chore: increase chat timeout (#768)

This commit is contained in:
Nathan.fooo 2024-08-30 09:37:22 +08:00 committed by GitHub
parent 54b811125e
commit 773efcd91a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 0 deletions

View File

@ -6,6 +6,7 @@ use shared_entity::dto::ai_dto::{
SummarizeRowResponse, TranslateRowParams, TranslateRowResponse,
};
use shared_entity::response::{AppResponse, AppResponseError};
use std::time::Duration;
use tracing::instrument;
impl Client {
@ -46,6 +47,7 @@ impl Client {
.http_client_with_auth(Method::POST, &url)
.await?
.json(&params)
.timeout(Duration::from_secs(30))
.send()
.await?;
@ -66,6 +68,7 @@ impl Client {
.http_client_with_auth(Method::POST, &url)
.await?
.json(&params)
.timeout(Duration::from_secs(30))
.send()
.await?;
log_request_id(&resp);

View File

@ -15,6 +15,7 @@ use shared_entity::dto::ai_dto::{
use shared_entity::response::{AppResponse, AppResponseError};
use std::pin::Pin;
use std::task::{Context, Poll};
use std::time::Duration;
use tracing::error;
impl Client {
@ -111,6 +112,7 @@ impl Client {
let resp = self
.http_client_with_auth(Method::GET, &url)
.await?
.timeout(Duration::from_secs(30))
.send()
.await?;
log_request_id(&resp);
@ -130,6 +132,7 @@ impl Client {
let resp = self
.http_client_with_auth(Method::GET, &url)
.await?
.timeout(Duration::from_secs(30))
.send()
.await?;
log_request_id(&resp);