Skip to content

Commit

Permalink
chore: increase chat timeout (#768)
Browse files Browse the repository at this point in the history
  • Loading branch information
appflowy authored Aug 30, 2024
1 parent 54b8111 commit 773efcd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions libs/client-api/src/http_ai.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -46,6 +47,7 @@ impl Client {
.http_client_with_auth(Method::POST, &url)
.await?
.json(&params)
.timeout(Duration::from_secs(30))
.send()
.await?;

Expand All @@ -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);
Expand Down
3 changes: 3 additions & 0 deletions libs/client-api/src/http_chat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit 773efcd

Please sign in to comment.