mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-27 12:35:05 +08:00
Fix internal error
This commit is contained in:
parent
b7109c0fd2
commit
c158d03337
@ -313,6 +313,7 @@ impl From<Opt> for Infos {
|
|||||||
#[cfg(all(not(debug_assertions), feature = "analytics"))]
|
#[cfg(all(not(debug_assertions), feature = "analytics"))]
|
||||||
no_analytics: _,
|
no_analytics: _,
|
||||||
zk_url: _,
|
zk_url: _,
|
||||||
|
s3_url: _,
|
||||||
} = options;
|
} = options;
|
||||||
|
|
||||||
let schedule_snapshot = match schedule_snapshot {
|
let schedule_snapshot = match schedule_snapshot {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use std::io::{BufReader, ErrorKind};
|
use std::io::{BufReader, ErrorKind, Seek, SeekFrom};
|
||||||
|
|
||||||
use actix_web::http::header::CONTENT_TYPE;
|
use actix_web::http::header::CONTENT_TYPE;
|
||||||
use actix_web::web::Data;
|
use actix_web::web::Data;
|
||||||
@ -395,7 +395,7 @@ async fn document_addition(
|
|||||||
return Err(MeilisearchHttpError::MissingPayload(format));
|
return Err(MeilisearchHttpError::MissingPayload(format));
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Err(e) = buffer.seek(std::io::SeekFrom::Start(0)).await {
|
if let Err(e) = buffer.seek(SeekFrom::Start(0)).await {
|
||||||
return Err(MeilisearchHttpError::Payload(ReceivePayload(Box::new(e))));
|
return Err(MeilisearchHttpError::Payload(ReceivePayload(Box::new(e))));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -411,8 +411,12 @@ async fn document_addition(
|
|||||||
};
|
};
|
||||||
|
|
||||||
if let Some(s3) = s3 {
|
if let Some(s3) = s3 {
|
||||||
|
update_file.seek(SeekFrom::Start(0)).unwrap();
|
||||||
let mut reader = BufReader::new(&*update_file);
|
let mut reader = BufReader::new(&*update_file);
|
||||||
s3.put_object_stream(&mut reader, format!("/update-files/{}", uuid)).unwrap();
|
match s3.put_object_stream(&mut reader, format!("/update-files/{}", uuid)) {
|
||||||
|
Ok(_) | Err(s3::error::S3Error::Http(_, _)) => (),
|
||||||
|
Err(e) => panic!("Error {}", e),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// we NEED to persist the file here because we moved the `udpate_file` in another task.
|
// we NEED to persist the file here because we moved the `udpate_file` in another task.
|
||||||
|
Loading…
Reference in New Issue
Block a user