MCPcopy Create free account
hub / github.com/AQ-MedAI/MedMemoryBench / close

Method close

methods/mem0/memory/storage.py:15–26  ·  view source on GitHub ↗

Close the database connection.

(self)

Source from the content-addressed store, hash-verified

13 self._create_history_table()
14
15 def close(self):
16 """Close the database connection."""
17 if self._closed:
18 return
19 with self._lock:
20 if self.connection:
21 try:
22 self.connection.close()
23 except Exception:
24 pass
25 self.connection = None
26 self._closed = True
27
28 def __del__(self):
29 """Destructor to ensure connection is closed."""

Callers 1

__del__Method · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected