Преглед на файлове

Set `check_same_thread` false so that one App can be used in parallel (#911)

Sidharth Mohanty преди 1 година
родител
ревизия
d8cdbe0041
променени са 2 файла, в които са добавени 2 реда и са изтрити 2 реда
  1. 1 1
      embedchain/embedchain.py
  2. 1 1
      embedchain/pipeline.py

+ 1 - 1
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

+ 1 - 1
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