File tree Expand file tree Collapse file tree 2 files changed +11
-9
lines changed
Expand file tree Collapse file tree 2 files changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -1459,9 +1459,10 @@ async def add_crawl_to_collection(
14591459 ) -> CollOut :
14601460 crawl_ids = set (add_remove .crawlIds )
14611461
1462- for config_id in add_remove .crawlconfigIds :
1463- for crawl_id in await colls .crawl_ops .get_config_crawl_ids (config_id ):
1464- crawl_ids .add (crawl_id )
1462+ for crawl_id in await colls .crawl_ops .get_config_crawl_ids (
1463+ add_remove .crawlconfigIds
1464+ ):
1465+ crawl_ids .add (crawl_id )
14651466
14661467 return await colls .add_crawls_to_collection (
14671468 coll_id , list (crawl_ids ), org , headers = dict (request .headers )
@@ -1480,9 +1481,10 @@ async def remove_crawl_from_collection(
14801481 ) -> CollOut :
14811482 crawl_ids = set (add_remove .crawlIds )
14821483
1483- for config_id in add_remove .crawlconfigIds :
1484- for crawl_id in await colls .crawl_ops .get_config_crawl_ids (config_id ):
1485- crawl_ids .add (crawl_id )
1484+ for crawl_id in await colls .crawl_ops .get_config_crawl_ids (
1485+ add_remove .crawlconfigIds
1486+ ):
1487+ crawl_ids .add (crawl_id )
14861488
14871489 return await colls .remove_crawls_from_collection (
14881490 coll_id , list (crawl_ids ), org , headers = dict (request .headers )
Original file line number Diff line number Diff line change @@ -386,9 +386,9 @@ async def list_crawls(
386386
387387 return crawls , total
388388
389- async def get_config_crawl_ids (self , cid : UUID ) -> list [str ]:
390- """get list of crawl ids belonging to given crawlconfig """
391- res = self .crawls .find ({"cid" : cid }, {"_id" : 1 })
389+ async def get_config_crawl_ids (self , cids : list [ UUID ] ) -> list [str ]:
390+ """get list of crawl ids belonging to given crawlconfigs """
391+ res = self .crawls .find ({"cid" : { "$in" : cids } }, {"_id" : 1 })
392392 res_list = await res .to_list ()
393393 return [res ["_id" ] for res in res_list ]
394394
You can’t perform that action at this time.
0 commit comments