From b65b6dac4b64619390b3333eff03e2ccdda5574b Mon Sep 17 00:00:00 2001 From: Pedro Rocha Date: Mon, 11 Nov 2024 23:30:02 +0800 Subject: [PATCH] refactor 'wait_merging_threads' to take &self instead of self to avoid the "cannot move out of dereference of self" error in multi-threaded scenarios. --- src/indexer/index_writer.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/indexer/index_writer.rs b/src/indexer/index_writer.rs index 6719afe9f9..0fb1c1a574 100644 --- a/src/indexer/index_writer.rs +++ b/src/indexer/index_writer.rs @@ -330,7 +330,7 @@ impl IndexWriter { /// If there are some merging threads, blocks until they all finish their work and /// then drop the `IndexWriter`. - pub fn wait_merging_threads(mut self) -> crate::Result<()> { + pub fn wait_merging_threads(&mut self) -> crate::Result<()> { // this will stop the indexing thread, // dropping the last reference to the segment_updater. self.drop_sender();