File tree Expand file tree Collapse file tree 1 file changed +20
-11
lines changed
src/superannotate/lib/infrastructure/services Expand file tree Collapse file tree 1 file changed +20
-11
lines changed Original file line number Diff line number Diff line change @@ -46,17 +46,26 @@ def list_by_names(
4646 folder : entities .FolderEntity ,
4747 names : List [str ],
4848 ):
49- return self .client .request (
50- self .URL_LIST_BY_NAMES ,
51- "post" ,
52- data = {
53- "project_id" : project .id ,
54- "team_id" : project .team_id ,
55- "folder_id" : folder .id ,
56- "names" : names ,
57- },
58- content_type = ItemListResponse ,
59- )
49+ chunk_size = 200
50+ items = []
51+ response = None
52+ for i in range (0 , len (names ), chunk_size ):
53+ response = self .client .request (
54+ self .URL_LIST_BY_NAMES ,
55+ "post" ,
56+ data = {
57+ "project_id" : project .id ,
58+ "team_id" : project .team_id ,
59+ "folder_id" : folder .id ,
60+ "names" : names [i : i + chunk_size ], # noqa
61+ },
62+ content_type = ItemListResponse ,
63+ )
64+ if not response .ok :
65+ return response
66+ items .extend (response .data )
67+ response .data = items
68+ return response
6069
6170 def attach (
6271 self ,
You can’t perform that action at this time.
0 commit comments