Skip to content

Commit ceae3c3

Browse files
fix: remove partials
1 parent ac35b82 commit ceae3c3

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
"""Main application to be deployed in for example uvicorn."""
2-
3-
from functools import partial
4-
52
from celery.signals import worker_init, worker_shutdown # type: ignore[import-untyped]
63
from celery_library.common import create_app as create_celery_app
74
from celery_library.signals import (
@@ -34,7 +31,7 @@
3431

3532
def worker_init_wrapper(sender, **_kwargs):
3633
assert _settings.STORAGE_CELERY # nosec
37-
return partial(on_worker_init, app_server)(sender, **_kwargs)
34+
return on_worker_init(sender, app_server, **_kwargs)
3835

3936

4037
worker_init.connect(worker_init_wrapper)

services/storage/tests/conftest.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
import random
1313
import sys
1414
from collections.abc import AsyncIterator, Awaitable, Callable
15-
from functools import partial
1615
from pathlib import Path
1716
from typing import Any, Final, cast
1817

@@ -1019,7 +1018,7 @@ async def with_storage_celery_worker(
10191018

10201019
def _on_worker_init_wrapper(sender: WorkController, **_kwargs):
10211020
assert app_settings.STORAGE_CELERY # nosec
1022-
return partial(on_worker_init, app_server)(sender, **_kwargs)
1021+
return on_worker_init(sender, app_server, **_kwargs)
10231022

10241023
worker_init.connect(_on_worker_init_wrapper)
10251024
worker_shutdown.connect(on_worker_shutdown)

0 commit comments

Comments
 (0)