Skip to content

Commit 02d1fee

Browse files
committed
@GitHK review: add exceptions
1 parent cdd1ba6 commit 02d1fee

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

services/storage/src/simcore_service_storage/modules/celery/client.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from models_library.progress_bar import ProgressReport
1212
from pydantic import ValidationError
1313
from servicelib.logging_utils import log_context
14+
from simcore_service_storage.exceptions.errors import ConfigurationError
1415

1516
from .models import TaskContext, TaskID, TaskState, TaskStatus, TaskUUID
1617

@@ -128,7 +129,7 @@ def _get_completed_task_uuids(self, task_context: TaskContext) -> set[TaskUUID]:
128129
search_key = _CELERY_TASK_META_PREFIX + _build_task_id_prefix(task_context)
129130
backend_client = self._celery_app.backend.client
130131
if hasattr(backend_client, "keys") and (
131-
keys := backend_client.keys(search_key + "*")
132+
keys := backend_client.keys(f"{search_key}*")
132133
):
133134
return {
134135
TaskUUID(
@@ -148,8 +149,8 @@ def _get_completed_task_uuids(self, task_context: TaskContext) -> set[TaskUUID]:
148149
)
149150
)
150151
return found_keys
151-
152-
return set()
152+
msg = f"Unsupported backend {self._celery_app.backend.__class__.__name__}"
153+
raise ConfigurationError(msg=msg)
153154

154155
@make_async()
155156
def get_task_uuids(self, task_context: TaskContext) -> set[TaskUUID]:

services/storage/tests/unit/test_rpc_handlers_simcore_s3.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ async def _fake_download_to_file_or_raise(session, url, dest_path):
465465
)
466466
],
467467
)
468-
@pytest.mark.parametrize("num_concurrent_calls", [1, 20])
468+
@pytest.mark.parametrize("num_concurrent_calls", [1, 20], ids=str)
469469
async def test_create_and_delete_folders_from_project(
470470
set_log_levels_for_noisy_libraries: None,
471471
initialized_app: FastAPI,

0 commit comments

Comments
 (0)