From d86fb21267b5938fcbb6811f1b2eb32714867fa0 Mon Sep 17 00:00:00 2001 From: Brendan Allan Date: Thu, 1 Feb 2024 12:57:43 +0800 Subject: [PATCH] disable orphan remover (#2027) --- core/src/api/locations.rs | 2 +- core/src/library/library.rs | 4 ++-- core/src/library/manager/mod.rs | 2 +- core/src/location/indexer/indexer_job.rs | 2 +- core/src/location/indexer/shallow.rs | 2 +- core/src/location/mod.rs | 2 +- core/src/object/fs/delete.rs | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/core/src/api/locations.rs b/core/src/api/locations.rs index 5c71d4aec..11aa8f2cf 100644 --- a/core/src/api/locations.rs +++ b/core/src/api/locations.rs @@ -393,7 +393,7 @@ pub(crate) fn mount() -> AlphaRouter { debug!("Disconnected {count} file paths from objects"); - library.orphan_remover.invoke().await; + // library.orphan_remover.invoke().await; } // rescan location diff --git a/core/src/library/library.rs b/core/src/library/library.rs index 60c9562cd..ae9ffe8c7 100644 --- a/core/src/library/library.rs +++ b/core/src/library/library.rs @@ -43,7 +43,7 @@ pub struct Library { // pub key_manager: Arc, /// p2p identity pub identity: Arc, - pub orphan_remover: OrphanRemoverActor, + // pub orphan_remover: OrphanRemoverActor, // The UUID which matches `config.instance_id`'s primary key. pub instance_uuid: Uuid, @@ -86,7 +86,7 @@ impl Library { db: db.clone(), // key_manager, identity, - orphan_remover: OrphanRemoverActor::spawn(db), + // orphan_remover: OrphanRemoverActor::spawn(db), instance_uuid, env: node.env.clone(), event_bus_tx: node.event_bus.0.clone(), diff --git a/core/src/library/manager/mod.rs b/core/src/library/manager/mod.rs index 37d4713e8..396909a26 100644 --- a/core/src/library/manager/mod.rs +++ b/core/src/library/manager/mod.rs @@ -494,7 +494,7 @@ impl Libraries { .insert(library.id, Arc::clone(&library)); if should_seed { - library.orphan_remover.invoke().await; + // library.orphan_remover.invoke().await; indexer::rules::seed::new_or_existing_library(&library).await?; } diff --git a/core/src/location/indexer/indexer_job.rs b/core/src/location/indexer/indexer_job.rs index b04de044f..5ba06656b 100644 --- a/core/src/location/indexer/indexer_job.rs +++ b/core/src/location/indexer/indexer_job.rs @@ -497,7 +497,7 @@ impl StatefulJob for IndexerJobInit { if run_metadata.total_updated_paths > 0 { // Invoking orphan remover here as we probably have some orphans objects due to updates - ctx.library.orphan_remover.invoke().await; + // ctx.library.orphan_remover.invoke().await; } if run_metadata.indexed_count > 0 diff --git a/core/src/location/indexer/shallow.rs b/core/src/location/indexer/shallow.rs index d7cc3dfcc..8b29d6657 100644 --- a/core/src/location/indexer/shallow.rs +++ b/core/src/location/indexer/shallow.rs @@ -190,7 +190,7 @@ pub async fn shallow( invalidate_query!(library, "search.objects"); } - library.orphan_remover.invoke().await; + // library.orphan_remover.invoke().await; Ok(()) } diff --git a/core/src/location/mod.rs b/core/src/location/mod.rs index b47d074a3..c11bb6006 100644 --- a/core/src/location/mod.rs +++ b/core/src/location/mod.rs @@ -852,7 +852,7 @@ pub async fn delete_directory( db.file_path().delete_many(children_params).exec().await?; - library.orphan_remover.invoke().await; + // library.orphan_remover.invoke().await; invalidate_query!(library, "search.paths"); invalidate_query!(library, "search.objects"); diff --git a/core/src/object/fs/delete.rs b/core/src/object/fs/delete.rs index 9bafa93fd..23ba73ed2 100644 --- a/core/src/object/fs/delete.rs +++ b/core/src/object/fs/delete.rs @@ -105,7 +105,7 @@ impl StatefulJob for FileDeleterJobInit { let init = self; invalidate_query!(ctx.library, "search.paths"); - ctx.library.orphan_remover.invoke().await; + // ctx.library.orphan_remover.invoke().await; Ok(Some(json!({ "init": init }))) }