Skip to content

Commit 974e005

Browse files
fix: items per page
1 parent e761d74 commit 974e005

File tree

3 files changed

+8
-3
lines changed
  • packages/service-library/src/servicelib/rabbitmq/rpc_interfaces/storage
  • services
    • storage/src/simcore_service_storage/api/_worker_tasks
    • web/server/src/simcore_service_webserver/storage

3 files changed

+8
-3
lines changed

packages/service-library/src/servicelib/rabbitmq/rpc_interfaces/storage/simcore_s3.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ async def start_export_data(
3434
*,
3535
paths_to_export: list[PathToExport],
3636
export_as: Literal["path", "download_link"],
37-
job_filter: AsyncJobFilter
37+
job_filter: AsyncJobFilter,
3838
) -> tuple[AsyncJobGet, AsyncJobFilter]:
3939
async_job_rpc_get = await submit(
4040
rabbitmq_rpc_client,
@@ -52,12 +52,14 @@ async def start_search(
5252
*,
5353
job_filter: AsyncJobFilter,
5454
name_pattern: str,
55+
items_per_page: int,
5556
) -> tuple[AsyncJobGet, AsyncJobFilter]:
5657
async_job_rpc_get = await submit(
5758
rabbitmq_rpc_client,
5859
rpc_namespace=STORAGE_RPC_NAMESPACE,
5960
method_name=TypeAdapter(RPCMethodName).validate_python("start_search"),
6061
job_filter=job_filter,
6162
name_pattern=name_pattern,
63+
items_per_page=items_per_page,
6264
)
6365
return async_job_rpc_get, job_filter

services/storage/src/simcore_service_storage/api/_worker_tasks/_simcore_s3.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ async def search(
139139
user_id: UserID,
140140
project_id: ProjectID | None,
141141
name_pattern: str,
142+
items_per_page: int,
142143
) -> None:
143144
with log_context(
144145
_logger,
@@ -156,6 +157,7 @@ async def search(
156157
user_id=user_id,
157158
project_id=project_id,
158159
name_pattern=name_pattern,
160+
items_per_page=items_per_page,
159161
):
160162
data = [
161163
SearchResult(

services/web/server/src/simcore_service_webserver/storage/_rest.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ class _PathParams(BaseModel):
558558

559559
rabbitmq_rpc_client = get_rabbitmq_rpc_client(request.app)
560560
_req_ctx = AuthenticatedRequestContext.model_validate(request)
561-
parse_request_path_parameters_as(_PathParams, request)
561+
path_params = parse_request_path_parameters_as(_PathParams, request)
562562
search_body = await parse_request_body_as(
563563
model_schema_cls=SearchBodyParams, request=request
564564
)
@@ -569,14 +569,15 @@ class _PathParams(BaseModel):
569569
product_name=_req_ctx.product_name,
570570
),
571571
name_pattern=search_body.name_pattern,
572+
items_per_page=search_body.items_per_page,
572573
)
573574
_job_id = f"{async_job_rpc_get.job_id}"
574575
return create_data_response(
575576
TaskGet(
576577
task_id=_job_id,
577578
status_href=f"{request.url.with_path(str(request.app.router['get_async_job_status'].url_for(task_id=_job_id)))}",
578579
abort_href=f"{request.url.with_path(str(request.app.router['cancel_async_job'].url_for(task_id=_job_id)))}",
579-
result_href=f"{request.url.with_path(str(request.app.router['get_async_job_result'].url_for(task_id=_job_id)))}",
580+
result_stream_href=f"{request.url.with_path(str(request.app.router['stream_search'].url_for(location_id=str(path_params.location_id), job_id=_job_id)))}",
580581
),
581582
status=status.HTTP_202_ACCEPTED,
582583
)

0 commit comments

Comments
 (0)