mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-04-25 08:26:21 +02:00
Fixing more Cassandra consistency issues (#488)
* Fixing more Cassandra work * Fix tests
This commit is contained in:
parent
ccaec88a72
commit
85e669c763
23 changed files with 196 additions and 208 deletions
|
|
@ -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,
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue