mirror of
https://github.com/perstarkse/minne.git
synced 2026-04-09 19:03:37 +02:00
feat: customizable data storage path
This commit is contained in:
@@ -5,6 +5,7 @@ use common::{storage::db::SurrealDbClient, utils::config::AppConfig};
|
||||
#[derive(Clone)]
|
||||
pub struct ApiState {
|
||||
pub db: Arc<SurrealDbClient>,
|
||||
pub config: AppConfig,
|
||||
}
|
||||
|
||||
impl ApiState {
|
||||
@@ -24,6 +25,7 @@ impl ApiState {
|
||||
|
||||
let app_state = ApiState {
|
||||
db: surreal_db_client.clone(),
|
||||
config: config.clone(),
|
||||
};
|
||||
|
||||
Ok(app_state)
|
||||
|
||||
@@ -30,12 +30,9 @@ pub async fn ingest_data(
|
||||
) -> Result<impl IntoResponse, ApiError> {
|
||||
info!("Received input: {:?}", input);
|
||||
|
||||
let file_infos = try_join_all(
|
||||
input
|
||||
.files
|
||||
.into_iter()
|
||||
.map(|file| FileInfo::new(file, &state.db, &user.id).map_err(AppError::from)),
|
||||
)
|
||||
let file_infos = try_join_all(input.files.into_iter().map(|file| {
|
||||
FileInfo::new(file, &state.db, &user.id, &state.config).map_err(AppError::from)
|
||||
}))
|
||||
.await?;
|
||||
|
||||
let payloads = IngestionPayload::create_ingestion_payload(
|
||||
|
||||
Reference in New Issue
Block a user