Skip to content

Commit

Permalink
chore: mypy + comment
Browse files Browse the repository at this point in the history
Signed-off-by: ThibaultFy <thibault.fouqueray@gmail.com>
  • Loading branch information
ThibaultFy committed Feb 8, 2024
1 parent 188d056 commit 502503e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions backend/substrapp/tasks/tasks_save_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def get_task_info(self, args: tuple, kwargs: dict) -> tuple[str, str]:
return function.key, channel_name

# Celery does not provide unpacked arguments, we are doing it in `get_task_info`
def on_success(self, retval: tuple[str, str], task_id: str, args: tuple, kwargs: dict[str, Any]) -> None:
def on_success(self, retval: tuple[dict, str], task_id: str, args: tuple, kwargs: dict[str, Any]) -> None:
orc_update_function_param, channel_name = retval

with get_orchestrator_client(channel_name) as client:
Expand All @@ -71,7 +71,7 @@ def on_success(self, retval: tuple[str, str], task_id: str, args: tuple, kwargs:
# Ack late and reject on worker lost allows use to
# see http://docs.celeryproject.org/en/latest/userguide/configuration.html#task-reject-on-worker-lost
# and https://github.com/celery/celery/issues/5106
def save_image_task(task: SaveImageTask, function_serialized: str, channel_name: str) -> tuple[str, str]:
def save_image_task(task: SaveImageTask, function_serialized: str, channel_name: str) -> tuple[dict, str]:
logger.info("Starting save_image_task")
logger.info(f"Parameters: function_serialized {function_serialized}, " f"channel_name {channel_name}")
# create serialized image
Expand Down Expand Up @@ -111,7 +111,6 @@ def save_image_task(task: SaveImageTask, function_serialized: str, channel_name:
"name": api_function.name,
"image": {
"checksum": api_function.image_checksum,
# TODO check url
"storage_address": api_function.image_address,
},
}
Expand Down

0 comments on commit 502503e

Please sign in to comment.