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 @@ -613,12 +613,11 @@ async def bulk_presigned_files(
613613 return resources , pages_optimized
614614
615615 async def validate_all_crawls_successful (self , crawl_ids : List [str ]):
616- """Validate that no crawls in list failed or else raise exception"""
617- result = await self .crawls .find_one (
618- {"_id" : {"$in" : crawl_ids }, "state" : {"$in" : FAILED_STATES }}
619- )
620- if result :
621- raise HTTPException (status_code = 400 , detail = "invalid_failed_crawl" )
616+ """Validate that crawls in list exist and are successful or else raise exception"""
617+ for crawl_id in crawl_ids :
618+ crawl = await self .get_base_crawl (crawl_id )
619+ if crawl .state in FAILED_STATES :
620+ raise HTTPException (status_code = 400 , detail = "invalid_failed_crawl" )
622621
623622 async def add_to_collection (
624623 self , crawl_ids : List [str ], collection_id : UUID , org : Organization
You can’t perform that action at this time.
0 commit comments