Skip to content

Commit 37b672e

Browse files
author
Andrei Neagu
committed
refactor setup
1 parent 793492e commit 37b672e

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

services/web/server/src/simcore_service_webserver/application_settings.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,9 @@ def to_client_statics(self) -> dict[str, Any]:
588588
"WEBSERVER_TRASH": {
589589
"TRASH_RETENTION_DAYS",
590590
},
591+
"WEBSERVER_LONG_RUNNING_TASKS": {
592+
"LONG_RUNNING_TASKS_NAMESPACE_SUFFIX",
593+
},
591594
},
592595
exclude_none=True,
593596
)

services/web/server/src/simcore_service_webserver/long_running_tasks/plugin.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@
44

55
from aiohttp import web
66
from models_library.utils.fastapi_encoders import jsonable_encoder
7-
from servicelib.aiohttp.application_setup import ensure_single_setup
7+
from servicelib.aiohttp.application_setup import app_module_setup
88
from servicelib.aiohttp.long_running_tasks._constants import (
99
RQT_LONG_RUNNING_TASKS_CONTEXT_KEY,
1010
)
1111
from servicelib.aiohttp.long_running_tasks.server import setup
1212
from servicelib.aiohttp.typing_extension import Handler
13+
from simcore_service_webserver.rabbitmq import ModuleCategory
1314

1415
from .. import rabbitmq_settings, redis
1516
from .._meta import API_VTAG
@@ -41,7 +42,12 @@ async def _test_task_context_decorator(
4142
return _test_task_context_decorator
4243

4344

44-
@ensure_single_setup(__name__, logger=_logger)
45+
@app_module_setup(
46+
__name__,
47+
ModuleCategory.ADDON,
48+
settings_name="WEBSERVER_LONG_RUNNING_TASKS",
49+
logger=_logger,
50+
)
4551
def setup_long_running_tasks(app: web.Application) -> None:
4652
# register all long-running tasks from different modules
4753
register_projects_long_running_tasks(app)

0 commit comments

Comments
 (0)