💡 All-in-one AI framework for semantic search, LLM orchestration and language model workflows
Python agentsaiai-agentsembeddingsinformation-retrievallanguage-modellarge-language-modelsllmnlppythonragretrieval-augmented-generationsearchsearch-enginesemantic-searchsentence-embeddingstransformerstxtaivector-databasevector-search
Update finalizers to check object attributes haven't already been cleared, closes #722
davidmezzetti3204e4a0d68b
diff --git a/src/python/txtai/app/base.py b/src/python/txtai/app/base.pyindex 58cf2a01..00040cfb 100644--- a/src/python/txtai/app/base.py+++ b/src/python/txtai/app/base.py@@ -82,7 +82,7 @@ class Application:Close threadpool when this object is garbage collected."""- if self.pool:+ if hasattr(self, "pool") and self.pool:self.pool.close()self.pool = Nonediff --git a/src/python/txtai/graph/rdbms.py b/src/python/txtai/graph/rdbms.pyindex 229b7ec9..721db94a 100644--- a/src/python/txtai/graph/rdbms.py+++ b/src/python/txtai/graph/rdbms.py@@ -35,7 +35,7 @@ class RDBMS(NetworkX):self.database = Nonedef __del__(self):- if self.database:+ if hasattr(self, "database") and self.database:self.database.close()def create(self):diff --git a/src/python/txtai/workflow/execute.py b/src/python/txtai/workflow/execute.pyindex 94deb808..eecb7126 100644--- a/src/python/txtai/workflow/execute.py+++ b/src/python/txtai/workflow/execute.py@@ -88,12 +88,12 @@ class Execute:Closes concurrent processing pools."""- if self.thread:+ if hasattr(self, "thread") and self.thread:self.thread.close()self.thread.join()self.thread = None- if self.process:+ if hasattr(self, "process") and self.process:self.process.close()self.process.join()self.process = None