From 651e73e0d7f9e833eed72ec71fa0f977fb04b1a2 Mon Sep 17 00:00:00 2001 From: Iris Date: Wed, 3 Jan 2024 14:52:04 +0100 Subject: [PATCH 1/2] fix: improve get_non_subscribed_domains speed --- src/endpoints/renewal/get_non_subscribed_domains.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/endpoints/renewal/get_non_subscribed_domains.rs b/src/endpoints/renewal/get_non_subscribed_domains.rs index a726576..3681eff 100644 --- a/src/endpoints/renewal/get_non_subscribed_domains.rs +++ b/src/endpoints/renewal/get_non_subscribed_domains.rs @@ -54,7 +54,8 @@ pub async fn handler( "$$local_id" ] }, - "_cursor.to": null + "root": true, + "_cursor.to": null, } } ], @@ -78,7 +79,8 @@ pub async fn handler( "$match": doc! { "$expr": doc! { "$eq": ["$domain", "$$domain_name"] - } + }, + "_cursor.to": null } } ], @@ -125,6 +127,7 @@ pub async fn handler( Ok(mut cursor) => { let mut results: Vec = Vec::new(); while let Some(doc) = cursor.next().await { + println!("doc: {:?}", doc); if let Ok(doc) = doc { let enabled = doc.get_bool("enabled").unwrap_or(false); if !enabled { From e49b2d0b2490a101ef635b582a0abf309d92c0e7 Mon Sep 17 00:00:00 2001 From: Iris Date: Wed, 3 Jan 2024 14:52:56 +0100 Subject: [PATCH 2/2] fix: remove log --- src/endpoints/renewal/get_non_subscribed_domains.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/endpoints/renewal/get_non_subscribed_domains.rs b/src/endpoints/renewal/get_non_subscribed_domains.rs index 3681eff..dc7205e 100644 --- a/src/endpoints/renewal/get_non_subscribed_domains.rs +++ b/src/endpoints/renewal/get_non_subscribed_domains.rs @@ -127,7 +127,6 @@ pub async fn handler( Ok(mut cursor) => { let mut results: Vec = Vec::new(); while let Some(doc) = cursor.next().await { - println!("doc: {:?}", doc); if let Ok(doc) = doc { let enabled = doc.get_bool("enabled").unwrap_or(false); if !enabled {