File tree Expand file tree Collapse file tree 2 files changed +12
-11
lines changed
storage/src/simcore_service_storage
web/server/src/simcore_service_webserver/api/v0 Expand file tree Collapse file tree 2 files changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -1003,7 +1003,7 @@ async def _search_project_s3_files(
10031003 async for s3_objects in s3_client .list_objects_paginated (
10041004 bucket = self .simcore_bucket_name ,
10051005 prefix = f"{ proj_id } /" ,
1006- items_per_page = items_per_page * 2 ,
1006+ items_per_page = items_per_page * 5 , # fetch more to filter locally
10071007 ):
10081008 for s3_obj in s3_objects :
10091009 filename = Path (s3_obj .object_key ).name
@@ -1030,15 +1030,16 @@ async def _search_project_s3_files(
10301030
10311031 if len (current_page_results ) >= items_per_page :
10321032 processed_results = await self ._process_s3_page_results (
1033- current_page_results
1033+ current_page_results [: items_per_page ]
10341034 )
10351035 yield processed_results
1036- current_page_results = [ ]
1036+ current_page_results = current_page_results [ items_per_page : ]
10371037
1038- if current_page_results :
1039- processed_results = await self ._process_s3_page_results (
1040- current_page_results
1041- )
1038+ # Handle remaining results, ensuring we don't exceed items_per_page
1039+ while current_page_results :
1040+ batch = current_page_results [:items_per_page ]
1041+ current_page_results = current_page_results [items_per_page :]
1042+ processed_results = await self ._process_s3_page_results (batch )
10421043 yield processed_results
10431044
10441045 except S3KeyNotFoundError :
Original file line number Diff line number Diff line change @@ -17111,12 +17111,12 @@ components:
1711117111 title: Namepattern
1711217112 description: Name pattern with wildcard support ('*', '?'). Minimum of 3
1711317113 non-wildcard characters required.
17114- itemsPerPage :
17114+ maxItemsPerPage :
1711517115 type: integer
17116- maximum: 1000
17116+ maximum: 25
1711717117 minimum: 1
17118- title: Itemsperpage
17119- description: Number of items per page
17118+ title: Maxitemsperpage
17119+ description: Max number of items per page
1712017120 default: 50
1712117121 type: object
1712217122 required:
You can’t perform that action at this time.
0 commit comments