File tree Expand file tree Collapse file tree 2 files changed +21
-14
lines changed
services/web/server/src/simcore_service_webserver/licenses Expand file tree Collapse file tree 2 files changed +21
-14
lines changed Original file line number Diff line number Diff line change 1313 _itis_vip_service ,
1414 _licensed_items_service ,
1515)
16- from simcore_service_webserver .licenses ._itis_vip_settings import ItisVipSettings
1716
1817from ..redis import get_redis_lock_manager_client_sdk , setup_redis
1918from ._itis_vip_models import CategoryTuple , ItisVipData , ItisVipResourceData
@@ -86,15 +85,10 @@ async def sync_resources_with_licensed_items(
8685
8786
8887def setup_itis_vip_syncer (
89- app : web .Application , settings : ItisVipSettings , resync_after : datetime .timedelta
88+ app : web .Application ,
89+ categories : list [CategoryTuple ],
90+ resync_after : datetime .timedelta ,
9091):
91- categories = settings .to_categories ()
92- if not categories :
93- _logger .warning (
94- "Skipping setup_itis_vip_syncer. %s did not provide any category" , settings
95- )
96- return
97-
9892 setup_redis (app )
9993
10094 async def _lifespan (app_ : web .Application ):
Original file line number Diff line number Diff line change @@ -41,8 +41,21 @@ def setup_licenses(app: web.Application):
4141 app .on_startup .append (_rpc .register_rpc_routes_on_startup )
4242
4343 if settings .LICENSES_ITIS_VIP_SYNCER_ENABLED and settings .LICENSES_ITIS_VIP :
44- _itis_vip_syncer_service .setup_itis_vip_syncer (
45- app ,
46- settings = settings .LICENSES_ITIS_VIP ,
47- resync_after = settings .LICENSES_ITIS_VIP_SYNCER_PERIODICITY ,
48- )
44+ categories = []
45+ if settings .LICENSES_ITIS_VIP :
46+ categories += settings .LICENSES_ITIS_VIP .to_categories ()
47+
48+ if settings .LICENSES_SPEAG_PHANTOMS :
49+ categories += settings .LICENSES_SPEAG_PHANTOMS .to_categories ()
50+
51+ if categories :
52+ _itis_vip_syncer_service .setup_itis_vip_syncer (
53+ app ,
54+ categories = categories ,
55+ resync_after = settings .LICENSES_ITIS_VIP_SYNCER_PERIODICITY ,
56+ )
57+ else :
58+ _logger .warning (
59+ "Skipping setup_itis_vip_syncer. Did not provide any category in settings %s" ,
60+ settings .model_dump_json (indent = 1 ),
61+ )
You can’t perform that action at this time.
0 commit comments