File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -612,7 +612,7 @@ async def _single_batch_check(
612612 semaphore .release ()
613613
614614 async def batch_check (
615- self , body : list [ClientCheckRequest ], options : dict [str , str ] = None
615+ self , body : list [ClientCheckRequest ], options : dict [str , str | int ] = None
616616 ):
617617 """
618618 Run a set of checks
@@ -631,7 +631,13 @@ async def batch_check(
631631
632632 max_parallel_requests = 10
633633 if options is not None and "max_parallel_requests" in options :
634- max_parallel_requests = options ["max_parallel_requests" ]
634+ if (
635+ isinstance (options ["max_parallel_requests" ], str )
636+ and options ["max_parallel_requests" ].isdigit ()
637+ ):
638+ max_parallel_requests = int (options ["max_parallel_requests" ])
639+ elif isinstance (options ["max_parallel_requests" ], int ):
640+ max_parallel_requests = options ["max_parallel_requests" ]
635641
636642 sem = asyncio .Semaphore (max_parallel_requests )
637643 batch_check_coros = [
Original file line number Diff line number Diff line change @@ -599,7 +599,7 @@ def _single_batch_check(
599599 )
600600
601601 def batch_check (
602- self , body : list [ClientCheckRequest ], options : dict [str , str ] = None
602+ self , body : list [ClientCheckRequest ], options : dict [str , str | int ] = None
603603 ):
604604 """
605605 Run a set of checks
@@ -619,7 +619,13 @@ def batch_check(
619619
620620 max_parallel_requests = 10
621621 if options is not None and "max_parallel_requests" in options :
622- max_parallel_requests = options ["max_parallel_requests" ]
622+ if (
623+ isinstance (options ["max_parallel_requests" ], str )
624+ and options ["max_parallel_requests" ].isdigit ()
625+ ):
626+ max_parallel_requests = int (options ["max_parallel_requests" ])
627+ elif isinstance (options ["max_parallel_requests" ], int ):
628+ max_parallel_requests = options ["max_parallel_requests" ]
623629
624630 batch_check_response = []
625631
You can’t perform that action at this time.
0 commit comments