mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-02-10 20:43:28 +01:00
Log the progress when a batch fails
This commit is contained in:
parent
8439aeb7cf
commit
bdd3005d10
@ -166,16 +166,31 @@ impl IndexScheduler {
|
|||||||
let processing_batch = &mut processing_batch;
|
let processing_batch = &mut processing_batch;
|
||||||
let progress = progress.clone();
|
let progress = progress.clone();
|
||||||
std::thread::scope(|s| {
|
std::thread::scope(|s| {
|
||||||
|
let p = progress.clone();
|
||||||
let handle = std::thread::Builder::new()
|
let handle = std::thread::Builder::new()
|
||||||
.name(String::from("batch-operation"))
|
.name(String::from("batch-operation"))
|
||||||
.spawn_scoped(s, move || {
|
.spawn_scoped(s, move || {
|
||||||
cloned_index_scheduler.process_batch(batch, processing_batch, progress)
|
cloned_index_scheduler.process_batch(batch, processing_batch, p)
|
||||||
})
|
})
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
match handle.join() {
|
match handle.join() {
|
||||||
Ok(ret) => ret,
|
Ok(ret) => {
|
||||||
|
if ret.is_err() {
|
||||||
|
if let Ok(progress_view) =
|
||||||
|
serde_json::to_string(&progress.as_progress_view())
|
||||||
|
{
|
||||||
|
tracing::warn!("Batch failed while doing: {progress_view}")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ret
|
||||||
|
}
|
||||||
Err(panic) => {
|
Err(panic) => {
|
||||||
|
if let Ok(progress_view) =
|
||||||
|
serde_json::to_string(&progress.as_progress_view())
|
||||||
|
{
|
||||||
|
tracing::warn!("Batch failed while doing: {progress_view}")
|
||||||
|
}
|
||||||
let msg = match panic.downcast_ref::<&'static str>() {
|
let msg = match panic.downcast_ref::<&'static str>() {
|
||||||
Some(s) => *s,
|
Some(s) => *s,
|
||||||
None => match panic.downcast_ref::<String>() {
|
None => match panic.downcast_ref::<String>() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user