File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -603,12 +603,11 @@ async def bulk_presigned_files(
603603 return resources , pages_optimized
604604
605605 async def validate_all_crawls_successful (self , crawl_ids : List [str ]):
606- """Validate that no crawls in list failed or else raise exception"""
607- result = await self .crawls .find_one (
608- {"_id" : {"$in" : crawl_ids }, "state" : {"$in" : FAILED_STATES }}
609- )
610- if result :
611- raise HTTPException (status_code = 400 , detail = "invalid_failed_crawl" )
606+ """Validate that crawls in list exist and are successful or else raise exception"""
607+ for crawl_id in crawl_ids :
608+ crawl = await self .get_base_crawl (crawl_id )
609+ if crawl .state in FAILED_STATES :
610+ raise HTTPException (status_code = 400 , detail = "invalid_failed_crawl" )
612611
613612 async def add_to_collection (
614613 self , crawl_ids : List [str ], collection_id : UUID , org : Organization
You can’t perform that action at this time.
0 commit comments