chore: shorten default write interval (#661)
This commit is contained in:
parent
59b2fefee9
commit
a6539dd963
|
|
@ -184,7 +184,7 @@ impl RedisSortedSet {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Serialize, Deserialize)]
|
||||
#[derive(Clone, Serialize, Deserialize, Debug)]
|
||||
pub struct PendingWrite {
|
||||
pub object_id: String,
|
||||
pub seq: i64,
|
||||
|
|
@ -201,7 +201,7 @@ impl PendingWrite {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Serialize_repr, Deserialize_repr)]
|
||||
#[derive(Clone, Serialize_repr, Deserialize_repr, Debug)]
|
||||
#[repr(u8)]
|
||||
pub enum WritePriority {
|
||||
High = 0,
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ pub fn get_configuration() -> Result<Config, anyhow::Error> {
|
|||
)
|
||||
.parse()?,
|
||||
edit_state_max_count: get_env_var("APPFLOWY_COLLAB_EDIT_STATE_MAX_COUNT", "100").parse()?,
|
||||
edit_state_max_secs: get_env_var("APPFLOWY_COLLAB_EDIT_STATE_MAX_SECS", "360").parse()?,
|
||||
edit_state_max_secs: get_env_var("APPFLOWY_COLLAB_EDIT_STATE_MAX_SECS", "60").parse()?,
|
||||
},
|
||||
redis_uri: get_env_var("APPFLOWY_REDIS_URI", "redis://localhost:6379").into(),
|
||||
};
|
||||
|
|
|
|||
|
|
@ -4,23 +4,25 @@ use appflowy_ai_client::client::AppFlowyAIClient;
|
|||
use appflowy_ai_client::dto::{
|
||||
EmbeddingEncodingFormat, EmbeddingInput, EmbeddingOutput, EmbeddingRequest, EmbeddingsModel,
|
||||
};
|
||||
|
||||
use database::index::{search_documents, SearchDocumentParams};
|
||||
use shared_entity::dto::search_dto::{
|
||||
SearchContentType, SearchDocumentRequest, SearchDocumentResponseItem,
|
||||
};
|
||||
use shared_entity::response::AppResponseError;
|
||||
use sqlx::PgPool;
|
||||
|
||||
use uuid::Uuid;
|
||||
|
||||
pub async fn search_document(
|
||||
pg_pool: &PgPool,
|
||||
openai: &AppFlowyAIClient,
|
||||
ai_client: &AppFlowyAIClient,
|
||||
uid: i64,
|
||||
workspace_id: Uuid,
|
||||
request: SearchDocumentRequest,
|
||||
metrics: &RequestMetrics,
|
||||
) -> Result<Vec<SearchDocumentResponseItem>, AppResponseError> {
|
||||
let embeddings = openai
|
||||
let embeddings = ai_client
|
||||
.embeddings(EmbeddingRequest {
|
||||
input: EmbeddingInput::String(request.query.clone()),
|
||||
model: EmbeddingsModel::TextEmbedding3Small.to_string(),
|
||||
|
|
|
|||
|
|
@ -192,7 +192,7 @@ pub fn get_configuration() -> Result<Config, anyhow::Error> {
|
|||
)
|
||||
.parse()?,
|
||||
edit_state_max_count: get_env_var("APPFLOWY_COLLAB_EDIT_STATE_MAX_COUNT", "100").parse()?,
|
||||
edit_state_max_secs: get_env_var("APPFLOWY_COLLAB_EDIT_STATE_MAX_SECS", "360").parse()?,
|
||||
edit_state_max_secs: get_env_var("APPFLOWY_COLLAB_EDIT_STATE_MAX_SECS", "60").parse()?,
|
||||
},
|
||||
mailer: MailerSetting {
|
||||
smtp_host: get_env_var("APPFLOWY_MAILER_SMTP_HOST", "smtp.gmail.com"),
|
||||
|
|
|
|||
Loading…
Reference in New Issue