Fixing more Cassandra consistency issues (#488)

* Fixing more Cassandra work

* Fix tests
This commit is contained in:
cybermaggedon 2025-09-04 00:58:11 +01:00 committed by GitHub
parent ccaec88a72
commit 85e669c763
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
23 changed files with 196 additions and 208 deletions

View file

@ -26,10 +26,10 @@ class Processor(TriplesStoreService):
id = params.get("id", default_ident)
# Use new parameter names, fall back to old for compatibility
cassandra_host = params.get("cassandra_host", params.get("graph_host"))
cassandra_username = params.get("cassandra_username", params.get("graph_username"))
cassandra_password = params.get("cassandra_password", params.get("graph_password"))
# Get Cassandra parameters
cassandra_host = params.get("cassandra_host")
cassandra_username = params.get("cassandra_username")
cassandra_password = params.get("cassandra_password")
# Resolve configuration with environment variable fallback
hosts, username, password = resolve_cassandra_config(
@ -45,9 +45,9 @@ class Processor(TriplesStoreService):
}
)
self.graph_host = hosts
self.username = username
self.password = password
self.cassandra_host = hosts
self.cassandra_username = username
self.cassandra_password = password
self.table = None
async def store_triples(self, message):
@ -59,16 +59,16 @@ class Processor(TriplesStoreService):
self.tg = None
try:
if self.username and self.password:
if self.cassandra_username and self.cassandra_password:
self.tg = TrustGraph(
hosts=self.graph_host,
hosts=self.cassandra_host,
keyspace=message.metadata.user,
table=message.metadata.collection,
username=self.username, password=self.password
username=self.cassandra_username, password=self.cassandra_password
)
else:
self.tg = TrustGraph(
hosts=self.graph_host,
hosts=self.cassandra_host,
keyspace=message.metadata.user,
table=message.metadata.collection,
)