Skip to content

Commit 7674c16

Browse files
committed
total may be null
1 parent fa281d3 commit 7674c16

File tree

3 files changed

+5
-10
lines changed

3 files changed

+5
-10
lines changed

services/storage/src/simcore_service_storage/datcore_dsm.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ async def list_paths(
6868
file_filter: Path | None,
6969
cursor: PathCursor | None,
7070
limit: NonNegativeInt,
71-
) -> tuple[list[PathMetaData], PathCursor | None, TotalNumber]:
71+
) -> tuple[list[PathMetaData], PathCursor | None, TotalNumber | None]:
7272
"""returns a page of the file meta data a user has access to"""
73-
return [], None, 0
73+
return [], None, None
7474

7575
async def list_files(
7676
self,

services/storage/src/simcore_service_storage/dsm_factory.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ async def list_paths(
7777
file_filter: Path | None,
7878
cursor: PathCursor | None,
7979
limit: NonNegativeInt,
80-
) -> tuple[list[PathMetaData], PathCursor | None, TotalNumber]:
80+
) -> tuple[list[PathMetaData], PathCursor | None, TotalNumber | None]:
8181
"""returns a page of the file meta data a user has access to"""
8282

8383
@abstractmethod

services/storage/src/simcore_service_storage/simcore_s3_dsm.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ async def list_paths(
179179
file_filter: Path | None,
180180
cursor: PathCursor | None,
181181
limit: NonNegativeInt,
182-
) -> tuple[list[PathMetaData], PathCursor | None, TotalNumber]:
182+
) -> tuple[list[PathMetaData], PathCursor | None, TotalNumber | None]:
183183
"""returns a page of the file meta data a user has access to"""
184184

185185
# if we have a file_filter, that means that we have at least a partial project ID
@@ -192,6 +192,7 @@ async def list_paths(
192192
) from exc
193193

194194
next_cursor: PathCursor | None = None
195+
total: TotalNumber | None = None
195196
async with self.engine.connect() as conn:
196197
if project_id:
197198
project_access_rights = await get_project_access_rights(
@@ -236,12 +237,6 @@ async def list_paths(
236237
"objects_next_cursor": objects_next_cursor,
237238
}
238239
)
239-
# TODO: this should be removed as this is not needed and performance intensive
240-
total = await get_s3_client(self.app).count_objects(
241-
bucket=self.simcore_bucket_name,
242-
prefix=file_filter,
243-
start_after=None,
244-
)
245240
else:
246241
(
247242
paths_metadata,

0 commit comments

Comments
 (0)