Skip to content

Commit f020bc3

Browse files
committed
task_id -> task_key in all celery tasks
1 parent 32ac020 commit f020bc3

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

services/api-server/src/simcore_service_api_server/celery_worker/worker_tasks/functions_tasks.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ async def _assemble_function_job_service(
103103

104104
async def run_function(
105105
task: Task,
106-
task_id: TaskKey,
106+
task_key: TaskKey,
107107
*,
108108
user_identity: Identity,
109109
function: RegisteredFunction,
@@ -113,7 +113,7 @@ async def run_function(
113113
x_simcore_parent_project_uuid: ProjectID | None,
114114
x_simcore_parent_node_id: NodeID | None,
115115
) -> RegisteredFunctionJob:
116-
assert task_id # nosec
116+
assert task_key # nosec
117117
app = get_app_server(task.app).app
118118
function_job_service = await _assemble_function_job_service(
119119
app=app, user_identity=user_identity

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717

1818

1919
async def compute_path_size(
20-
task: Task, task_id: TaskKey, user_id: UserID, location_id: LocationID, path: Path
20+
task: Task, task_key: TaskKey, user_id: UserID, location_id: LocationID, path: Path
2121
) -> ByteSize:
22-
assert task_id # nosec
22+
assert task_key # nosec
2323
with log_context(
2424
_logger,
2525
logging.INFO,
@@ -31,12 +31,12 @@ async def compute_path_size(
3131

3232
async def delete_paths(
3333
task: Task,
34-
task_id: TaskKey,
34+
task_key: TaskKey,
3535
user_id: UserID,
3636
location_id: LocationID,
3737
paths: set[Path],
3838
) -> None:
39-
assert task_id # nosec
39+
assert task_key # nosec
4040
with log_context(
4141
_logger,
4242
logging.INFO,

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,18 @@
2626

2727

2828
async def _task_progress_cb(
29-
task: Task, task_id: TaskKey, report: ProgressReport
29+
task: Task, task_key: TaskKey, report: ProgressReport
3030
) -> None:
3131
worker = get_app_server(task.app).task_manager
3232
assert task.name # nosec
3333
await worker.set_task_progress(
34-
task_key=task_id,
34+
task_key=task_key,
3535
report=report,
3636
)
3737

3838

3939
async def deep_copy_files_from_project(
40-
task: Task, task_id: TaskKey, user_id: UserID, body: FoldersBody
40+
task: Task, task_key: TaskKey, user_id: UserID, body: FoldersBody
4141
) -> dict[str, Any]:
4242
with log_context(
4343
_logger,
@@ -51,7 +51,7 @@ async def deep_copy_files_from_project(
5151
async with ProgressBarData(
5252
num_steps=1,
5353
description="copying files",
54-
progress_report_cb=functools.partial(_task_progress_cb, task, task_id),
54+
progress_report_cb=functools.partial(_task_progress_cb, task, task_key),
5555
) as task_progress:
5656
await dsm.deep_copy_project_simcore_s3(
5757
user_id,
@@ -66,7 +66,7 @@ async def deep_copy_files_from_project(
6666

6767
async def export_data(
6868
task: Task,
69-
task_id: TaskKey,
69+
task_key: TaskKey,
7070
*,
7171
user_id: UserID,
7272
paths_to_export: list[PathToExport],
@@ -77,7 +77,7 @@ async def export_data(
7777
with log_context(
7878
_logger,
7979
logging.INFO,
80-
f"'{task_id}' export data (for {user_id=}) fom selection: {paths_to_export}",
80+
f"'{task_key}' export data (for {user_id=}) fom selection: {paths_to_export}",
8181
):
8282
dsm = get_dsm_provider(get_app_server(task.app).app).get(
8383
SimcoreS3DataManager.get_location_id()
@@ -92,13 +92,13 @@ async def export_data(
9292
async def _progress_cb(report: ProgressReport) -> None:
9393
assert task.name # nosec
9494
await get_app_server(task.app).task_manager.set_task_progress(
95-
task_id, report
95+
task_key, report
9696
)
97-
_logger.debug("'%s' progress %s", task_id, report.percent_value)
97+
_logger.debug("'%s' progress %s", task_key, report.percent_value)
9898

9999
async with ProgressBarData(
100100
num_steps=1,
101-
description=f"'{task_id}' export data",
101+
description=f"'{task_key}' export data",
102102
progress_report_cb=_progress_cb,
103103
) as progress_bar:
104104
return await dsm.create_s3_export(
@@ -117,7 +117,7 @@ async def export_data_as_download_link(
117117
AccessRightError: in case user can't access project
118118
"""
119119
s3_object = await export_data(
120-
task=task, task_id=task_id, user_id=user_id, paths_to_export=paths_to_export
120+
task=task, task_key=task_id, user_id=user_id, paths_to_export=paths_to_export
121121
)
122122

123123
dsm = get_dsm_provider(get_app_server(task.app).app).get(

0 commit comments

Comments
 (0)