Allow init of redis without registry (useful for external scripts)

This commit is contained in:
phil 2024-05-05 18:49:51 +02:00
parent 53f2594cdd
commit 29543b9766

View file

@ -95,14 +95,15 @@ class Store:
""" """
asyncpg_conn: Connection asyncpg_conn: Connection
async def setup(self): async def setup(self, with_registry=False):
""" """
Setup the live service for the main Gisaf application: Setup the live service for the main Gisaf application:
- Create connection for the publishers - Create connection for the publishers
- Create connection for redis listeners (websocket service) - Create connection for redis listeners (websocket service)
""" """
await self.create_connections() await self.create_connections()
await self.get_live_layer_defs() if with_registry:
await self.get_live_layer_defs()
async def create_connections(self): async def create_connections(self):
""" """
@ -433,7 +434,7 @@ class Store:
async def setup_redis(): async def setup_redis():
global store global store
await store.setup() await store.setup(with_registry=True)
async def setup_redis_cache(): async def setup_redis_cache():