From d8cdbe00418bcff470420222f7e160b259106e7c Mon Sep 17 00:00:00 2001 From: Sidharth Mohanty Date: Wed, 8 Nov 2023 23:56:31 +0530 Subject: [PATCH] Set `check_same_thread` false so that one App can be used in parallel (#911) --- embedchain/embedchain.py | 2 +- embedchain/pipeline.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/embedchain/embedchain.py b/embedchain/embedchain.py index eb0dc62a..58174d4e 100644 --- a/embedchain/embedchain.py +++ b/embedchain/embedchain.py @@ -88,7 +88,7 @@ class EmbedChain(JSONSerializable): self._telemetry_props = {"class": self.__class__.__name__} self.telemetry = AnonymousTelemetry(enabled=self.config.collect_metrics) # Establish a connection to the SQLite database - self.connection = sqlite3.connect(SQLITE_PATH) + self.connection = sqlite3.connect(SQLITE_PATH, check_same_thread=False) self.cursor = self.connection.cursor() # Create the 'data_sources' table if it doesn't exist diff --git a/embedchain/pipeline.py b/embedchain/pipeline.py index 64e38e8b..28a6cb1a 100644 --- a/embedchain/pipeline.py +++ b/embedchain/pipeline.py @@ -120,7 +120,7 @@ class Pipeline(EmbedChain): self.telemetry = AnonymousTelemetry(enabled=self.config.collect_metrics) # Establish a connection to the SQLite database - self.connection = sqlite3.connect(SQLITE_PATH) + self.connection = sqlite3.connect(SQLITE_PATH, check_same_thread=False) self.cursor = self.connection.cursor() # Create the 'data_sources' table if it doesn't exist