mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-06-13 16:55:14 +02:00
Fix an init issue
This commit is contained in:
parent
731c3a34d4
commit
226af71a2f
1 changed files with 16 additions and 3 deletions
|
|
@ -157,9 +157,17 @@ class Processor(AsyncProcessor):
|
|||
logger.info("Config service initialized")
|
||||
|
||||
async def _discover_workspaces(self):
|
||||
workspaces = await self.config.table_store.get_keys(
|
||||
WORKSPACES_NAMESPACE, WORKSPACE_TYPE
|
||||
)
|
||||
logger.info("Discovering workspaces from Cassandra...")
|
||||
try:
|
||||
workspaces = await self.config.table_store.get_keys(
|
||||
WORKSPACES_NAMESPACE, WORKSPACE_TYPE
|
||||
)
|
||||
logger.info(f"Discovered workspaces: {workspaces}")
|
||||
except Exception as e:
|
||||
logger.error(
|
||||
f"Workspace discovery failed: {e}", exc_info=True
|
||||
)
|
||||
return
|
||||
|
||||
for workspace_id in workspaces:
|
||||
if workspace_id not in self.workspace_consumers:
|
||||
|
|
@ -220,6 +228,11 @@ class Processor(AsyncProcessor):
|
|||
await self.pubsub.ensure_topic(self.config_request_queue_base)
|
||||
await self.push() # Startup poke: empty types = everything
|
||||
await self.system_consumer.start()
|
||||
|
||||
# Start the config push subscriber so we receive our own
|
||||
# workspace change notifications.
|
||||
await self.config_sub_task.start()
|
||||
|
||||
await self._discover_workspaces()
|
||||
|
||||
async def push(self, changes=None, workspace_changes=None):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue