forked from Rockachopa/Timmy-time-dashboard
committed by
GitHub
parent
11ba21418a
commit
82fb2417e3
@@ -93,16 +93,19 @@ class UnifiedMemory:
|
||||
|
||||
conn = sqlite3.connect(str(self.db_path))
|
||||
try:
|
||||
conn.execute("PRAGMA journal_mode=WAL")
|
||||
conn.execute("PRAGMA busy_timeout=5000")
|
||||
conn.executescript(_LOCAL_SCHEMA)
|
||||
conn.commit()
|
||||
logger.info("Brain local DB initialized at %s", self.db_path)
|
||||
logger.info("Brain local DB initialized at %s (WAL mode)", self.db_path)
|
||||
finally:
|
||||
conn.close()
|
||||
|
||||
def _get_conn(self) -> sqlite3.Connection:
|
||||
"""Get a SQLite connection."""
|
||||
"""Get a SQLite connection with WAL mode and busy timeout."""
|
||||
conn = sqlite3.connect(str(self.db_path))
|
||||
conn.row_factory = sqlite3.Row
|
||||
conn.execute("PRAGMA busy_timeout=5000")
|
||||
return conn
|
||||
|
||||
def _get_embedder(self):
|
||||
|
||||
Reference in New Issue
Block a user