mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-05-25 15:25:12 +02:00
Tidy closedown
This commit is contained in:
parent
2db050fe93
commit
de3525371c
5 changed files with 38 additions and 5 deletions
12
scripts/dump-parquet
Executable file
12
scripts/dump-parquet
Executable file
|
|
@ -0,0 +1,12 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
import pyarrow.parquet as pq
|
||||
import sys
|
||||
|
||||
for file in sys.argv[1:]:
|
||||
|
||||
table = pq.read_table(file).to_pandas()
|
||||
print(table)
|
||||
|
||||
|
||||
|
||||
|
|
@ -24,7 +24,7 @@ default_subscriber = module
|
|||
default_graph_host='localhost'
|
||||
default_directory = "."
|
||||
default_file_template = "triples-{id}.parquet"
|
||||
default_rotation_time = 30
|
||||
default_rotation_time = 60
|
||||
|
||||
class Processor(Consumer):
|
||||
|
||||
|
|
|
|||
|
|
@ -67,6 +67,13 @@ class EmbeddingsClient:
|
|||
|
||||
def __del__(self):
|
||||
|
||||
if self.client:
|
||||
self.client.close()
|
||||
if hasattr(self, "consumer"):
|
||||
self.consumer.unsubscribe()
|
||||
self.consumer.close()
|
||||
|
||||
if hasattr(self, "producer"):
|
||||
self.producer.flush()
|
||||
self.producer.close()
|
||||
|
||||
self.client.close()
|
||||
|
||||
|
|
|
|||
|
|
@ -66,5 +66,13 @@ class GraphRagClient:
|
|||
|
||||
def __del__(self):
|
||||
|
||||
if hasattr(self, "consumer"):
|
||||
self.consumer.unsubscribe()
|
||||
self.consumer.close()
|
||||
|
||||
if hasattr(self, "producer"):
|
||||
self.producer.flush()
|
||||
self.producer.close()
|
||||
|
||||
self.client.close()
|
||||
|
||||
|
|
|
|||
|
|
@ -68,7 +68,13 @@ class LlmClient:
|
|||
|
||||
def __del__(self):
|
||||
|
||||
self.producer.close()
|
||||
self.consumer.close()
|
||||
if hasattr(self, "consumer"):
|
||||
self.consumer.unsubscribe()
|
||||
self.consumer.close()
|
||||
|
||||
if hasattr(self, "producer"):
|
||||
self.producer.flush()
|
||||
self.producer.close()
|
||||
|
||||
self.client.close()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue