Skip to content

Commit 60374bd

Browse files
move out from loop
1 parent e86ae99 commit 60374bd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

services/storage/src/simcore_service_storage/simcore_s3_dsm.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1001,6 +1001,7 @@ async def _search_project_s3_files(
10011001
min_parts_for_valid_s3_object = 2
10021002

10031003
try:
1004+
name_pattern_lower = name_pattern.lower()
10041005
async for s3_objects in s3_client.list_objects_paginated(
10051006
bucket=self.simcore_bucket_name,
10061007
prefix=f"{proj_id}/",
@@ -1010,7 +1011,7 @@ async def _search_project_s3_files(
10101011
filename = Path(s3_obj.object_key).name
10111012

10121013
if not (
1013-
fnmatch.fnmatch(filename.lower(), name_pattern.lower())
1014+
fnmatch.fnmatch(filename.lower(), name_pattern_lower)
10141015
and len(s3_obj.object_key.split("/"))
10151016
>= min_parts_for_valid_s3_object
10161017
):

0 commit comments

Comments
 (0)