mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-09-06 12:46:31 +00:00
fix race condition: take the rtxn before entering the thread so we're sure we won't try to retrieve deleted tasks
This commit is contained in:
@ -446,16 +446,7 @@ impl IndexScheduler {
|
||||
Ok(())
|
||||
})?;
|
||||
|
||||
// We shouldn't crash the tick function if we can't send data to the webhooks
|
||||
let webhooks = self.webhooks();
|
||||
if !webhooks.webhooks.is_empty() {
|
||||
let cloned_index_scheduler = self.private_clone();
|
||||
std::thread::spawn(move || {
|
||||
if let Err(e) = cloned_index_scheduler.notify_webhooks(webhooks, &ids) {
|
||||
tracing::error!("Failure to notify webhooks: {e}");
|
||||
}
|
||||
});
|
||||
}
|
||||
self.notify_webhooks(ids);
|
||||
|
||||
#[cfg(test)]
|
||||
self.breakpoint(crate::test_utils::Breakpoint::AfterProcessing);
|
||||
|
Reference in New Issue
Block a user